Closed (duplicate)
Project:
Drupal core
Version:
5.2
Component:
database system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
8 Sep 2007 at 17:06 UTC
Updated:
10 Sep 2007 at 15:48 UTC
The seqence is set incorrectly so when I add a new role I get:
* warning: pg_query() [function.pg-query]: Query failed: ERROR: duplicate key violates unique constraint "role_pkey" in /var/www/blah/includes/database.pgsql.inc on line 125.
* user warning: query: INSERT INTO role (name) VALUES ('blah') in /var/www/blah/includes/database.pgsql.inc on line 144.
The error is:
blah=# select * from role;
rid | name
-----+--------------------
1 | anonymous user
2 | authenticated user
(2 rows)
blah# select last_value from role_rid_seq ;
last_value
------------
1
(1 row)
This seq should start at 3.
The fix is:
SELECT setval('role_rid_seq', 3);
Comments
Comment #1
bdragon commentedMarking as duplicate of http://drupal.org/node/171536 .