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
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | pi_pgsql_cid_seq_47x.patch_1.txt | 1.58 KB | dww |
| #7 | pi_pgsql_cid_seq_5x.patch_1.txt | 1.6 KB | dww |
| #4 | pi_pgsql_cid_seq_5x.patch.txt | 2.39 KB | dww |
| #3 | pi_pgsql_cid_seq_47-2x.patch.txt | 2.4 KB | dww |
| #2 | pi_pgsql_cid_seq_47x.patch.txt | 2.03 KB | dww |
Comments
Comment #1
dwwhttp://drupal.org/node/70454
Comment #2
dwwwhoops, 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...
Comment #3
dwwpatch for DRUPAL-4-7--2
Comment #4
dwwpatch for HEAD (5.x)
Comment #5
dwwdrat, 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*
Comment #6
dwwComment #7
dwwproject_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
Comment #8
dwwnew patch for 4.7.x-* (applies cleanly for both DRUPAL-4-7 and DRUPAL-4-7--2)
Comment #9
dwwafter yet more testing, committed to HEAD, DRUPAL-4-7--2, and DRUPAL-4-7.
Comment #10
(not verified) commented