| From: | Jeremy Hansen <jeremy(at)xxedgexx(dot)com> | 
|---|---|
| To: | <pgsql-general(at)postgresql(dot)org> | 
| Subject: | race conditions in my sequences | 
| Date: | 2001-08-16 17:33:37 | 
| Message-ID: | Pine.LNX.4.33.0108161325110.30565-100000@srv1.ecropolis.com | 
| Views: | Whole Thread | Raw Message | Download mbox | Resend email | 
| Thread: | |
| Lists: | pgsql-general | 
I'd like to explain what I'm trying to do.
I have three tables, primary key, bug_id.  Bug_id is a foreign key in the 
other two tables, with a cascade on update and delete.
What I've done is created three sequences for each table for the bug_id.  
Sometimes the table with the primary key gets its sequence out of sync 
from the other two tables and I start getting referential integrity 
violation problems and then all inserts  start getting dropped.
I think this problem may be due to a date field I have in the table with 
the primary key.  I'm taking things like:
Mon Aug 13 10:40:36 PDT 2001 and placing it into a timestamp field.  The 
reason I say this is only because my logs show:
postgres[29169] [1] ERROR:  Bad timestamp external representation
'day/time/etc'
and then immediately following that is:
postgres[29169]: [2] ERROR:  <unnamed> referential integrity violation -
key referenced from env_info not found in summary
Thing is, majority of the time the date inserts fine.
Any suggestions would be more then appreciate as always.  Is there a 
better way to do what I'm trying to do?  Should I be converting my date to 
something else before insert?
thanks
-jeremy
-- 
salad.
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Jan Wieck | 2001-08-16 17:36:23 | Re: Storing images in PG? | 
| Previous Message | Tom Lane | 2001-08-16 17:32:51 | Re: Roll Back dont roll back counters |