From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | "P(dot) Dwayne Miller" <dmiller(at)espgroup(dot)net> |
Cc: | pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: Primary Key |
Date: | 2001-06-19 21:34:24 |
Message-ID: | 1616.992986464@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
"P. Dwayne Miller" <dmiller(at)espgroup(dot)net> writes:
> CREATE TABLE message
> (
> int4 msgid not null,
> text msgtext,
> CONSTRAINT cons_001_pk PRIMARY KEY on (msgid)
> );
> The first two actually create a PRIMARY KEY on msgid. The third seems
> to have a PRIMARY KEY on 'oid', not 'msgid', though it does create a
> unique index on 'msgid'.
After fixing the several obvious syntax errors, it works fine for me:
regression=# CREATE TABLE message
regression-# (
regression(# msgid int4 not null,
regression(# msgtext text,
regression(# CONSTRAINT cons_001_pk PRIMARY KEY (msgid)
regression(# );
NOTICE: CREATE TABLE/PRIMARY KEY will create implicit index 'cons_001_pk' for table 'message'
CREATE
regression=# \d message
Table "message"
Attribute | Type | Modifier
-----------+---------+----------
msgid | integer | not null
msgtext | text |
Primary Key: cons_001_pk
regression=#
Is Cold Fusion perhaps doing strange things to the query behind your
back? None of those CREATE TABLE commands are legal SQL according
to my references.
regards, tom lane
From | Date | Subject | |
---|---|---|---|
Next Message | P. Dwayne Miller | 2001-06-19 22:11:12 | Re: Primary Key |
Previous Message | Ludovic PENET | 2001-06-19 20:49:54 | Embedding postgresql |