pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: David Lizano <david.lizano@izanet.com>
To: pgsql-sql@postgresql.org
Subject: Re: Are circular REFERENCES possible ?
Date: Tue, 07 Aug 2001 12:26:09 +0200
Message-ID: <5.1.0.14.2.20010807122105.00b8a710@mail.izanet.com> (raw)
In-Reply-To: <5.1.0.14.0.20010807114609.00a18490@mail.niftycom.com>


>
>
>Which leads to :
>
>CREATE TABLE shops ( id_shop SERIAL PRIMARY KEY, id_cust integer 
>REFERENCES customers, .......)

You can't reference to a table who doesn't exists still.


>CREATE TABLE customers ( id_cust SERIAL PRIMARY KEY, id_defaultshop 
>integer REFERENCES shops, .......)

Perhaps you can do it something like that if:
1.- Create the two tables.
2.- Use alter table to add the constraint "references".





view thread (15+ messages)  latest in thread

Message-ID: <5.1.0.14.2.20010807122105.00b8a710@mail.izanet.com>
Permalink:  ../5.1.0.14.2.20010807122105.00b8a710@mail.izanet.com/
Also on:    postgresql.org/message-id/5.1.0.14.2.20010807122105.00b8a710@mail.izanet.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: david.lizano@izanet.com
  Subject: Re: Are circular REFERENCES possible ?
  In-Reply-To: <5.1.0.14.2.20010807122105.00b8a710@mail.izanet.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox