pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andreas <maps.on@gmx.net>
To: Bruno Wolff III <bruno@wolff.to>
Cc: pgsql-sql@postgresql.org
Subject: Re: Multitable uniqueness ?
Date: Thu, 27 May 2004 09:22:53 +0200
Message-ID: <40B5974D.9000008@gmx.net> (raw)
In-Reply-To: <20040526122013.GA472@wolff.to>
References: <40B40B4A.4050908@gmx.net>
	<20040526122013.GA472@wolff.to>

Bruno Wolff III wrote:

>On Wed, May 26, 2004 at 05:13:14 +0200,
>  Andreas <maps.on@gmx.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   ;)




view thread (7+ messages)  latest in thread

Message-ID: <40B5974D.9000008@gmx.net>
Permalink:  ../40B5974D.9000008@gmx.net/
Also on:    postgresql.org/message-id/40B5974D.9000008@gmx.net

 · 

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: maps.on@gmx.net, bruno@wolff.to
  Subject: Re: Multitable uniqueness ?
  In-Reply-To: <40B5974D.9000008@gmx.net>

* 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