[ dspam-Bug Tracker-3609004 ] Postgresql 9.2 vs INSERT INTO dspam_token_data duplicate key

SourceForge.net <[email protected]> Mon, 25 Mar 2013 05:41:11 -0700
Newsgroups gmane.mail.spam.dspam.devel
Message-ID <[email protected]>
Bug Tracker item #3609004, was opened at 2013-03-25 05:41
Message generated for change (Tracker Item Submitted) made by 
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=1126467&aid=3609004&group_id=250683

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: v3.10.x
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: tom ()
Assigned to: Nobody/Anonymous (nobody)
Summary: Postgresql 9.2 vs INSERT INTO dspam_token_data duplicate key

Initial Comment:
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.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=1126467&aid=3609004&group_id=250683

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_mar