pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Achilleus Mantzios <achill@matrix.gatewaynet.com>
To: Huub <v.niekerk@freeler.nl>
Cc: pgsql-sql@postgresql.org
Subject: Re: primary keys
Date: Thu, 7 Nov 2002 16:28:48 +0200 (EET)
Message-ID: <Pine.LNX.4.44.0211071626300.7264-100000@matrix.gatewaynet.com> (raw)
In-Reply-To: <aqb8b8$1k8v$1@news.hub.org>

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.

I dont know the way in pgAdminII, but from psql simply give:

CREATE TABLE foo(
name varchar(20) NOT NULL,
id int4 NOT NULL,
PRIMARY KEY (name,id));

>
> Thanks
>
> Huub
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
>

==================================================================
Achilleus Mantzios
S/W Engineer
IT dept
Dynacom Tankers Mngmt
Nikis 4, Glyfada
Athens 16610
Greece
tel:    +30-10-8981112
fax:    +30-10-8981877
email:  achill@matrix.gatewaynet.com
        mantzios@softlab.ece.ntua.gr




view thread (10+ messages)  latest in thread

Message-ID: <Pine.LNX.4.44.0211071626300.7264-100000@matrix.gatewaynet.com>
Permalink:  ../Pine.LNX.4.44.0211071626300.7264-100000@matrix.gatewaynet.com/
Also on:    postgresql.org/message-id/Pine.LNX.4.44.0211071626300.7264-100000@matrix.gatewaynet.com

 · 

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: achill@matrix.gatewaynet.com, v.niekerk@freeler.nl
  Subject: Re: primary keys
  In-Reply-To: <Pine.LNX.4.44.0211071626300.7264-100000@matrix.gatewaynet.com>

* 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