Menu

#165 Postgresql 9.2 vs INSERT INTO dspam_token_data duplicate key

v3.10.x
open
nobody
None
5
2013-03-25
2013-03-25
Anonymous
No

Hi,

I'm experiencing a bug which might be related to
https://sourceforge.net/tracker/?func=detail&atid=1126467&aid=3413998&group_id=250683
but on a different table.

I use

dspam 3.10.2-4
postgresql 9.2.3-1

and see a lot of these in the logs:

postgres[15536]: ERROR: duplicate key value violates unique constraint "dspam_token_data_uid_token_key"
postgres[15536]: DETAIL: Key (uid, token)=(1, -9183792722717634573) already exists.
postgres[15536]: STATEMENT: PREPARE dspam_update_plan (bigint) AS UPDATE dspam_token_data SET last_hit=CURRENT_DATE,innocent_hits=innocent_hits+1 WHERE uid=1 AND token=$1;PREPARE dspam_insert_plan (bigint,int,int) AS INSERT INTO dspam_token_data (uid,token,spam_hits,innocent_hits,last_hit) VALUES (1,$1,$2,$3,CURRENT_DATE);
postgres[15536]: ERROR: duplicate key value violates unique constraint "dspam_token_data_uid_token_key"
postgres[15536]: DETAIL: Key (uid, token)=(1, -1460994571532515437) already exists.
postgres[15536]: STATEMENT: PREPARE dspam_update_plan (bigint) AS UPDATE dspam_token_data SET last_hit=CURRENT_DATE,innocent_hits=innocent_hits+1 WHERE uid=1 AND token=$1;PREPARE dspam_insert_plan (bigint,int,int) AS INSERT INTO dspam_token_data (uid,token,spam_hits,innocent_hits,last_hit) VALUES (1,$1,$2,$3,CURRENT_DATE);
postgres[15536]: ERROR: duplicate key value violates unique constraint "dspam_token_data_uid_token_key"
postgres[15536]: DETAIL: Key (uid, token)=(1, 9222095682490567990) already exists.
postgres[15536]: STATEMENT: PREPARE dspam_update_plan (bigint) AS UPDATE dspam_token_data SET last_hit=CURRENT_DATE,innocent_hits=innocent_hits+1 WHERE uid=1 AND token=$1;PREPARE dspam_insert_plan (bigint,int,int) AS INSERT INTO dspam_token_data (uid,token,spam_hits,innocent_hits,last_hit) VALUES (1,$1,$2,$3,CURRENT_DATE);

Setting "standard_conforming_strings = Off" in postgresql.conf helps to workaround the issue, but breaks other things running against this database.

Discussion


Log in to post a comment.