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 [EMAIL PROTECTED] http://funkturm.homeip.net/~peter ---------------------------(end of broadcast)--------------------------- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/users-lounge/docs/faq.html