race conditions in my sequences - Mailing list pgsql-general

From Jeremy Hansen
Subject race conditions in my sequences
Date
Msg-id Pine.LNX.4.33.0108161325110.30565-100000@srv1.ecropolis.com
Whole thread Raw
Responses Re: race conditions in my sequences
List 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.


pgsql-general by date:

Previous
From: Michelle Murrain
Date:
Subject: OBDC Error
Next
From: "Joe Conway"
Date:
Subject: Re: Storing images in PG?