pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tomasz Myrta <jasiek@klaster.net>
To: Huub <v.niekerk@freeler.nl>
Cc: pgsql-sql@postgresql.org
Subject: Re: primary keys
Date: Thu, 07 Nov 2002 15:49:06 +0100
Message-ID: <3DCA7D62.2070806@klaster.net> (raw)
References: <aqb8b8$1k8v$1@news.hub.org>

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




view thread (10+ messages)  latest in thread

Message-ID: <3DCA7D62.2070806@klaster.net>
Permalink:  ../3DCA7D62.2070806@klaster.net/
Also on:    postgresql.org/message-id/3DCA7D62.2070806@klaster.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: jasiek@klaster.net, v.niekerk@freeler.nl
  Subject: Re: primary keys
  In-Reply-To: <3DCA7D62.2070806@klaster.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