create parent after children - Mailing list pgsql-general

From carlos.ohiggins@yahoo.com
Subject create parent after children
Date
Msg-id f7e4b018-04c3-48c4-bf80-b1d0d8099f12@e17g2000hsg.googlegroups.com
Whole thread Raw
List pgsql-general
Hello Guys,
I need to create a postgres 7.3 (done that, its bundled with an app I
have to extend).
Now I need to create 2 tables one a table of events. usual mix of
column types, with varchar as primary key.

However when I get 3 events in with specific characteristics   I need
to create a summary event saying " 3 events of type X received).

So I need I guess to create a foreign key in the table with the 3
events in, pointing to the primary key in the summary event table.
But normally the parent is created 1st then the children - so I am
confused now about what constraints to put where so i can ensure
things make sense.
any help appreciated..

Carlos


pgsql-general by date:

Previous
From: "Andrus"
Date:
Subject: How to get schema name which violates fk constraint
Next
From: "Dave Fry"
Date:
Subject: statement_timeout by host?