foreign key, create table, and transactions - Mailing list pgsql-sql

From Jeffrey Green
Subject foreign key, create table, and transactions
Date
Msg-id F823415B-DCE7-11D6-B141-000393675CB6@columbia.edu
Whole thread Raw
Responses Re: foreign key, create table, and transactions
List pgsql-sql
> Hello.  I was wondering if anybody's run across the problem of 
> creating tables with foreign key constraints out of order.  What I 
> mean by this is that say I want a table called <pictures> that has a 
> foreign key reference to a table <people>.  If I define pictures 
> before table, I keep getting an error (Relation "people" doesn't 
> exist).  I tried to group them into a transaction with
>
> BEGIN;
> SET CONSTRAINTS ALL DEFERRED;
>
> CREATE TABLE pictures...
>
> CREATE TABLE people...
>
> COMMIT;
>
> But still no.  Is it a requirement of postgres that all creates 
> essentially be "in order" when there are foreign key constraints?  
> Please cc a response to jng15 at columbia dot edu.  Thanks so much.



pgsql-sql by date:

Previous
From: "Brian Ward"
Date:
Subject: functions that return a dataset or set of rows
Next
From: Stephan Szabo
Date:
Subject: Re: error...what to do?