pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Thomas F. O'Connell <tfo@monsterlabs.com>
To: pgsql-admin@postgresql.org.pgsql-general
Subject: Re: Primary Keys
Date: Tue, 01 May 2001 10:13:28 -0500
Message-ID: <3AEED298.2080804@monsterlabs.com> (raw)
References: <9ckl5q$2jp4$1@news.tht.net>

Brian Z wrote:

> How can you create a Primary Key which contains multiple columns on for a
> table.

first of all, i recommend checking out the syntax for the CREATE TABLE 
command. it's available here:

http://postgresql.readysetnet.com/users-lounge/docs/7.1/postgres/sql-createtable.html

for a quick example, though:

create table foo (
	bar int4,
	baz int4,
	ola int4,
	primary key( bar, baz )
);

this statement will make the columns bar and baz coincidentally the 
primary key for the table foo.

-tfo




view thread (4+ messages)  latest in thread

Message-ID: <3AEED298.2080804@monsterlabs.com>
Permalink:  ../3AEED298.2080804@monsterlabs.com/
Also on:    postgresql.org/message-id/3AEED298.2080804@monsterlabs.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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: tfo@monsterlabs.com, pgsql-admin@postgresql.org.pgsql-general
  Subject: Re: Primary Keys
  In-Reply-To: <3AEED298.2080804@monsterlabs.com>
  References: <9ckl5q$2jp4$1@news.tht.net> <3AEED298.2080804@monsterlabs.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