From: Grigoriy G. Vovk <grigoriy.vovk@linustech.com.cy>
To: Cedar Cox <cedarc@visionforisrael.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: REFERENCES constraint
Date: Wed, 8 Aug 2001 20:26:33 +0300 (EEST)
Message-ID: <20010808202427.Q574-100000@callisto.internal.linustech.com.cy> (raw)
In-Reply-To: <Pine.LNX.4.21.0108081850160.12272-100000@nanu.visionforisrael.com>
As for me it is looking as not good normalized structure.
After normalization should not be any questions, I think...
Aug 8, 19:02 +0300, Cedar Cox wrote:
>
> Two questions (maybe they are silly..)
>
> 1. Can a column reference more than one table? (This assumes you use a
> single sequence to generate the IDs for both "tbla" and "tblb". I guess
> you would also have the problem of enforcing a unique index. Say what?!
> A unique index across multiple tables.. absurd :) eg..
>
> CREATE TABLE blah (
> id int4,
> f_id int4 REFERENCES tbla (id) REFERENCES tblb (id)
> )
>
> 2. Can a column reference another column in the same table? eg..
>
> CREATE TABLE bloo (
> id int4,
> p_id int4 REFERENCES bloo (id)
> -- or
> --p_id int4 REFERENCES (id)
> )
>
> I'm guessing the answer is no, in which case I have to fall back to
> writing custom PL/ functions and triggers. Just thought I'd ask anyway.
> It would be nice if it were this easy though...
>
> -Cedar
> p.s. please CC my on this thread.. I'm on vacation (on this list) :0
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org
>
my best regards,
----------------
Grigoriy G. Vovk
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: grigoriy.vovk@linustech.com.cy, cedarc@visionforisrael.com
Subject: Re: REFERENCES constraint
In-Reply-To: <20010808202427.Q574-100000@callisto.internal.linustech.com.cy>
* 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