Re: Where's The Primary Key?

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: "A(dot)Bhuvaneswaran" <bhuvan(at)symonds(dot)net>
Cc: Jim Louis <jim(dot)louis(at)worldnet(dot)att(dot)net>, pgsql-novice(at)postgresql(dot)org
Subject: Re: Where's The Primary Key?
Date: 2003-07-28 16:47:04
Message-ID: 20030728164704.GB25693@wolff.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On Mon, Jul 28, 2003 at 09:26:33 +0530,
>
> Primary key is the combination of unique index + not null. In your case,
> both are listed. For further details refer pg_indexes system view.

That isn't the whole story. The primary key of a table is also a default
for foreign keys. There can be several columns that have a unique index
and a not null constraint, but there can be only one primary key.
(The primary key can also be multicolumn.)

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Josh Berkus 2003-07-28 17:11:31 Re: Accessing Postgres db from apache using PHP
Previous Message bruce 2003-07-28 16:32:16 Re: Accessing Postgres db from apache using PHP