Jeremy Hansen writes:
> 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.
What you want is one sequence that generates the primary key, and the
foreign key columns you declare as integer and fill them in manually by
reading the generated primary key for the tuple you want to reference.
--
Peter Eisentraut peter_e@gmx.net http://funkturm.homeip.net/~peter