Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 2893147759D for ; Thu, 7 Nov 2002 10:27:27 -0500 (EST) Received: from serwer.skawsoft.com.pl (serwer.skawsoft.com.pl [213.25.37.66]) by postgresql.org (Postfix) with ESMTP id 19F934771D4 for ; Thu, 7 Nov 2002 09:45:24 -0500 (EST) Received: from klaster.net (ph225.krakow.cvx.ppp.tpnet.pl [217.99.208.225]) by serwer.skawsoft.com.pl (Postfix) with ESMTP id C8F162B2AF; Thu, 7 Nov 2002 15:36:11 +0100 (CET) Message-ID: <3DCA7D62.2070806@klaster.net> Date: Thu, 07 Nov 2002 15:49:06 +0100 From: Tomasz Myrta User-Agent: Mozilla/5.0 (Windows; U; Win 9x 4.90; PL; rv:1.1) Gecko/20020826 X-Accept-Language: pl, en-us, en MIME-Version: 1.0 To: Huub Cc: pgsql-sql@postgresql.org Subject: Re: primary keys References: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200211/107 X-Sequence-Number: 10249 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