Re: naming a primary key possible?

From: Erik Jones <erik(at)myemma(dot)com>
To: Ow Mun Heng <Ow(dot)Mun(dot)Heng(at)wdc(dot)com>
Cc: pgsql-general(at)postgreSQL(dot)org
Subject: Re: naming a primary key possible?
Date: 2007-08-28 02:03:46
Message-ID: 6BA44F38-AD69-4E9F-B9AB-3461D522D04E@myemma.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


On Aug 27, 2007, at 8:50 PM, Ow Mun Heng wrote:

> Is it possible to name a primary key (composite) primary key rather
> than
> have pg default to table_name_pkey??
>
> I tried something like
>
> primary key pkey_table_short_form_name (a,b,c)
>
> but it didnt' work.
>

Give this a shot:

CONTRAINT pkey_table_short_form_name PRIMARY KEY (a,b,c)

That's not really clear from the top of the CREATE TABLE docs but
there's an example at the bottom that shows it.

Erik Jones

Software Developer | Emma®
erik(at)myemma(dot)com
800.595.4401 or 615.292.5888
615.292.0777 (fax)

Emma helps organizations everywhere communicate & market in style.
Visit us online at http://www.myemma.com

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Michael Glaesemann 2007-08-28 02:12:52 Re: naming a primary key possible?
Previous Message Erik Jones 2007-08-28 01:51:46 Re: Tables dissapearing