Re: primary keys

From: Tomasz Myrta <jasiek(at)klaster(dot)net>
To: Huub <v(dot)niekerk(at)freeler(dot)nl>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: primary keys
Date: 2002-11-07 14:49:06
Message-ID: 3DCA7D62.2070806@klaster.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Uz.ytkownik Huub napisa?:
> Hi,
>
> I want to create a table which has 2 columns, and both columns have to
> be primary key (or: together they are the primary key). How can I do
> this using SQL? Using pgAdminII for Postgres7.2.2 on RH8.
Dependent on what you need:
1) you can create primary key based on 2 fields
2) you can't create 2 primary keys - but you can create primary key on
first field and create unique index on second one.
Tomasz Myrta

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2002-11-07 14:55:29 Re: [SQL] Problem: Referential Integrity Constraints lost
Previous Message Bruno Wolff III 2002-11-07 14:35:30 Re: primary keys