Re: Multitable uniqueness ?

From: Andreas <maps(dot)on(at)gmx(dot)net>
To: Bruno Wolff III <bruno(at)wolff(dot)to>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Multitable uniqueness ?
Date: 2004-05-27 07:22:53
Message-ID: 40B5974D.9000008@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Bruno Wolff III wrote:

>On Wed, May 26, 2004 at 05:13:14 +0200,
> Andreas <maps(dot)on(at)gmx(dot)net> wrote:
>
>
>>Is there a way to have something like this : UNIQUE (table_1.id,
>>table_2.xxx)
>>
>>
>
>Postgres doesn't support database constraints at this time which is
>what you would need to do this simply.
>
>

Well, a simple way was to have a table_1-foreign key in the table 2.
I just thought since there is:

table_1 <--1:n-- table_x <--1:n-- table_2

and I hoped not having to add
table_1 <--1:n-- table_2
just to have uniquness of an attribute of table_2 and the key of table_1

>You can enforce this constraint by creating a third table
>
That is more efford than to stuff the column into table_2.

Thanks anyway ;)

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Willem de Jong 2004-05-27 11:14:58 Re: sum ( time) problem
Previous Message Andreas 2004-05-27 07:07:38 Re: Multitable uniqueness ?