When adding a followup to an issue I got the following warnings:

pg_query(): Query failed: ERROR: relation "project_cid_seq" does not exist in /var/www/html/drupal/includes/database.pgsql.inc on line 84.
query: SELECT nextval('project_cid_seq') in /var/www/html/drupal/includes/database.pgsql.inc on line 103.

The first followup (first ever on this drupal installation) was inserted correctly anyway but all subsequent followups give additional errors and are not added.

    * warning: pg_query(): Query failed: ERROR: relation "project_cid_seq" does not exist in /var/www/html/drupal/includes/database.pgsql.inc on line 84.
    * user warning: query: SELECT nextval('project_cid_seq') in /var/www/html/drupal/includes/database.pgsql.inc on line 103.
    * warning: pg_query(): Query failed: ERROR: duplicate key violates unique constraint "project_comments_pkey" in /var/www/html/drupal/includes/database.pgsql.inc on line 84.
    * user warning: query: INSERT INTO project_comments (cid, nid, uid, created, changed, body, data, file_path, file_mime, file_size) VALUES (0, 25, 3, 1157531698, 1157531698, 'Followup text', 'N;', '', '', 0) in /var/www/html/drupal/includes/database.pgsql.inc on line 103.

Drupal 4.7.3
postgresql 7.4.13
php 4.3.9
apache httpd 2.0.52

Comments

dww’s picture

Status: Active » Closed (duplicate)
dww’s picture

Project: Project » Project issue tracking
Component: Issues » Comments
Assigned: Unassigned » dww
Priority: Normal » Critical
Status: Closed (duplicate) » Needs review
StatusFileSize
new2.03 KB

whoops, that one was about rid (release id), this is about cid (comment id). rids went away with the new release system, but cids are still around, and this bug still exists. re-opening. this is critical for pgsql, since you can't reply to issues at all. :(

attached patch tested heavily for DRUPAL-4-7. Patches for other branches coming next...

dww’s picture

StatusFileSize
new2.4 KB

patch for DRUPAL-4-7--2

dww’s picture

StatusFileSize
new2.39 KB

patch for HEAD (5.x)

dww’s picture

drat, i don't want to change it from {project}_cid to {project_comments}_cid, even though that's more accurate, without adding a mysql clause to these db updates to change the records in the {sequences} table in mysql. :(

so, either i need to add that to the db updates for all these patches, or just add the {project}_cid sequence on pgsql to match the existing one in mysql....

*sigh*

dww’s picture

Status: Needs review » Needs work
dww’s picture

Status: Needs work » Needs review
StatusFileSize
new1.6 KB

project_cid_seq will be going away in the medium term future, anyway:
http://drupal.org/node/18920

so, it's not worth spending *too* much effort on this. easier for everyone (if less standardized) is to just stick with the same sequence name "{project}_cid" so that the code doesn't change at all, mysql users (the vast majority) don't need to run the update for their code to keep working, etc.

new patch for HEAD/5.x

dww’s picture

StatusFileSize
new1.58 KB

new patch for 4.7.x-* (applies cleanly for both DRUPAL-4-7 and DRUPAL-4-7--2)

dww’s picture

Status: Needs review » Fixed

after yet more testing, committed to HEAD, DRUPAL-4-7--2, and DRUPAL-4-7.

Anonymous’s picture

Status: Fixed » Closed (fixed)