Hi,
To create database tables for PostgreSQL something like the following is needed.
I think the "user" key in delicious_user needs quoting else PGSQL thinks it's a reserved word or something.
drop table delicious_user;
drop table delicious_link;
drop table delicious_tag;
drop table delicious_block;
CREATE TABLE delicious_user (
uid int NOT NULL,
"user" varchar(255),
pass varchar(255),
lastupdate varchar(20),
lastcode int,
overview int NOT NULL default '0',
pagesize int NOT NULL default '0',
PRIMARY KEY (uid)
);
CREATE TABLE delicious_link (
lid int NOT NULL,
uid int NOT NULL,
href text,
description text,
extended text,
linktime int default 0,
hash varchar(64),
synced smallint,
PRIMARY KEY (lid),
UNIQUE (hash)
);
CREATE TABLE delicious_tag (
lid int NOT NULL,
uid int NOT NULL,
name varchar(255) NOT NULL,
synced smallint,
UNIQUE (lid, name)
);
CREATE TABLE delicious_block (
"dbid" int NOT NULL,
"title" varchar(255) NOT NULL,
"users" text,
"tags" text,
"maxentries" int,
PRIMARY KEY (dbid)
);
CREATE INDEX synced_idx ON delicious_link( synced );
CREATE INDEX uid_idx ON delicious_user ( uid );
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | delicious-4.6.0-postgresql[1].patch | 5.87 KB | David Goodwin |
| #1 | delicious.tar_1.gz | 29.13 KB | asdzxczx |
Comments
Comment #1
asdzxczx commentedI attached corrected delicious module - it works with PostgreSQL. I haven't tested it with MySQL. I rewrote few queries (probably improved performance for user's tags display). There's are some differences between MySQL and PostgreSQL - one very important and usually making modules broken is that when you use GROUP BY in PostgreSQL you can only select columns that are either aggregate functions or are listed in GROUP BY clause. Nothing more is allowed. This is usually broken in MySQL-only modules.
Comment #2
David Goodwin commentedHi,
Line 609 of delicious.module needs to read like :
$result = db_query_range("SELECT distinct(dl.description), dl.href, dl.linktime FROM {delicious_link} dl LEFT JOIN {delicious_tag} dt ON dl.lid = dt.lid LEFT JOIN {users} u ON dl.uid = u.uid $where ORDER BY dl.linktime desc", 0, intval($block->maxentries));
Missing the dl.linktime results in a PostgreSQL error where it moans about a field given in ORDER BY needs to be in the SELECT clause.
Otherwise appears to at least work now, although I encountered rendering problems (i.e sticking it in the right hand side content column resulted in a page that didn't render beyond the middle column).
David.
Comment #3
David Goodwin commentedRendering problems were due to a typo on line 79 of delicious.module, namely it should look something like :
Thanks
David.
Comment #4
merlinofchaos commentedPlease supply patches, preferably using 'cvs diff -up' rather than the whole module.
This module isn't one of my higher priorities and I don't have the time to compare a new module to the original to see exactly what's been changed.
Comment #5
David Goodwin commentedsee attached patch.
Comment #6
Anonymous (not verified) commentedNo longer supporting 4.X