Re: references definition to multi-field primary key

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: Gary Stainburn <gary(dot)stainburn(at)ringways(dot)co(dot)uk>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: references definition to multi-field primary key
Date: 2002-08-16 15:59:11
Message-ID: 20020816155911.GA15999@wolff.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Fri, Aug 16, 2002 at 16:15:57 +0100,
Gary Stainburn <gary(dot)stainburn(at)ringways(dot)co(dot)uk> wrote:
>
> I only want the insert to work if prpid matches pgpid and prnozzle matches
> pgnozzle.

There are several typos in your sample that make it hard to know for
sure what you want to do. However I suspect you just want to add a
foreign key clause to your table definition. These can refer to more
than one column (unlike references). My memory is that you need a matching
unique index defined for the table you are referencing.

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Alexander M. Pravking 2002-08-16 16:26:13 Results from EXECUTE
Previous Message Gary Stainburn 2002-08-16 15:15:57 references definition to multi-field primary key