Re: Primary Key - Mailing list pgsql-hackers

From Thomas Swan
Subject Re: Primary Key
Date
Msg-id 3B2FD446.9060506@ics.olemiss.edu
Whole thread Raw
In response to Primary Key  ("P. Dwayne Miller" <dmiller@espgroup.net>)
Responses Re: Primary Key
List pgsql-hackers
Tom Lane wrote:<br /><blockquote cite="mid:1616.992986464@sss.pgh.pa.us" type="cite"><pre wrap="">After fixing the
severalobvious syntax errors, it works fine for me:<br /><br />regression=# CREATE TABLE message<br />regression-# (<br
/>regression(#  msgid int4 not null,<br />regression(#   msgtext text,<br />regression(#   CONSTRAINT cons_001_pk
PRIMARYKEY (msgid)<br />regression(# );<br />NOTICE:  CREATE TABLE/PRIMARY KEY will create implicit index 'cons_001_pk'
fortable 'message'<br />CREATE<br />regression=# \d message<br />        Table "message"<br /> Attribute |  Type   |
Modifier<br/>-----------+---------+----------<br /> msgid     | integer | not null<br /> msgtext   | text    |<br
/>PrimaryKey: cons_001_pk<br /><br />regression=#<br /><br />Is Cold Fusion perhaps doing strange things to the query
behindyour<br />back?  None of those CREATE TABLE commands are legal SQL according<br />to my
references.</pre></blockquote>I've been using the syntax "PRIMARY KEY (<i>column_name</i> [, <i>column_name</i> ]),"
withoutthe constraint name, and the "<i>COLUMN_NAME TYPE</i> PRIMARY KEY" syntax for sometime now.   I may be admitting
toSQL heresy in saying that; but, that's the syntax I've seen in MySQL and in quite a few SQL/database books.<br /><br
/>AFIAK, it's a legal table creation statement.<br /><br /><br /> 

pgsql-hackers by date:

Previous
From: "P. Dwayne Miller"
Date:
Subject: Re: Primary Key
Next
From: Tom Lane
Date:
Subject: Re: Primary Key