Re: primary keys

From: "Rachel(dot)Vaudron" <rachel(at)lazaret(dot)unice(dot)fr>
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:01:46
Message-ID: Pine.LNX.4.33.0211071459290.10443-100000@lazaret.unice.fr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hi,

For example you can do something like that:

CREATE TABLE "try" (
"field1" TEXT NOT NULL,
"field2" INT4 NOT NULL,
"field3" TEXT, PRIMARY KEY (field1, field2));

**************************************
Rachel(dot)Vaudron(at)lazaret(dot)unice(dot)fr
Laboratoire de prehistoire du Lazaret
33 bis bd Franck Pilatte 06300 Nice
tel:04-92-00-17-37/fax:04-92-00-17-39
******** Windows a bug's life ********

On Wed, 6 Nov 2002, Huub wrote:

> 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.
>
> Thanks
>
> Huub
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
>

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Christoph Haller 2002-11-07 14:06:53 Re: how to get the source table & field name of a view field
Previous Message terry 2002-11-07 13:54:24 Re: primary keys