This adds PostgreSQL support for the Project module, version 4.5.

NOTE! Apply patch http://drupal.org/node/16733 before this one -- otherwise it might not apply correctly and even if it did, the project pages won't show any "submit bug" links etc.

Comments

elonen’s picture

The schema in the patch is missing a sequence creation statement:

CREATE SEQUENCE project_cid_seq INCREMENT 1 START 1;

Cvbge’s picture

Title: PostgreSQL support for 4.5 » PostgreSQL support for 4.5/cvs

I've created project.pgsql from scratch (I've missed this bug report and didn't know there's already a patch for this)
It's against cvs, and I've only checked that the schema loads cleanly into postgres. I need to check differences between my and elonen's schemas.

Current version does not have needed sequences defined, I'll fix that later.

Cvbge’s picture

StatusFileSize
new4.48 KB

I've created project.pgsql from scratch (I've missed this bug report and didn't know there's already a patch for this)
It's against cvs, and I've only checked that the schema loads cleanly into postgres. I need to check differences between my and elonen's schemas.

Current version does not have needed sequences defined, I'll fix that later.

Cvbge’s picture

StatusFileSize
new3.02 KB

Here's new version, it's almost the same as previous one; mainly added missing seqences.

I'm not sure what is the correct equivalent of mysql's "blob" - "text" or "bytea"? Staying with text for now.

Elonen wrote in comment something about index on different data types 'suppressing' the index - I don't know anything about such things, haven't found any reference in google and postgres didn't give any warning when creating index. So for now I'll leave it with different data types, if anyone knows anything about this please tell me.

Cvbge’s picture

StatusFileSize
new1.15 KB

It seems I can attach only one file at time :(
Will be attaching 3 files that fix following errors: (partially contains the same fixes as from elonen, updated for cvs version)
There are some fixes in eleonen's patch that are not included in my patch, as I they didn't occured for me.

sql_1.diff (the same as in eleonen's patch): when viewing project/user:

warning: pg_query(): Query failed: ERROR:  column "n.title" must appear in the GROUP BY clause or be used in an aggregate function in /var/www/includes/database.pgsql.inc on line 45.
query: SELECT n.nid, n.title, n.changed, COUNT(p.nid) AS count FROM node n LEFT JOIN project_issues p ON n.nid = p.pid AND p.state IN (1,2,8) WHERE n.type = 'project_project' AND n.status = 1 AND n.uid = 1 GROUP BY n.nid  ORDER BY  n.title ASC in /var/www/includes/database.pgsql.inc on line 62.
Cvbge’s picture

StatusFileSize
new3.39 KB

sql_2.diff: when viewing project/issues/user and no projects defined:

warning: pg_query(): Query failed: ERROR:  invalid input syntax for integer: "" in /var/www/includes/database.pgsql.inc on line 45.
query: SELECT n.*, u.uid, u.name, u.picture, u.data FROM node n INNER JOIN users u ON u.uid = n.uid WHERE n.nid = '' AND n.type = 'project_project' in /var/www/includes/database.pgsql.inc on line 62.
Cvbge’s picture

StatusFileSize
new1.06 KB

sql_3.diff (the same as in eleonen's patch): when viewing project/issues/statistics:

warning: pg_query(): Query failed: ERROR:  column "n.title" must appear in the GROUP BY clause or be used in an aggregate function in /var/www/includes/database.pgsql.inc on line 45.
query: SELECT n.nid, n.title, p.state, COUNT(p.nid) AS total FROM node n INNER JOIN project_issues p ON n.nid = p.pid WHERE n.type = 'project_project' AND n.status = 1 GROUP BY n.nid, p.state in /var/www/includes/database.pgsql.inc on line 62.
killes@www.drop.org’s picture

Committed most recent pgsql file.

Committed sql_1.diff
Committed sql_3.diff
Committed sql_2.diff (last chunk)

Anonymous’s picture