471,073 Members | 1,305 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,073 software developers and data experts.

pgsql documentation error ?


Synopsis

CREATE [ [ LOCAL ] { TEMPORARY | TEMP } ] TABLE /table_name/ (
{ /column_name/ /data_type/ [ DEFAULT /default_expr/ ] [ /column_constraint/ [, ... ] ]
| /table_constraint/ } [, ... ]
)
[ INHERITS ( /parent_table/ [, ... ] ) ]
[ WITH OIDS | WITHOUT OIDS ]

so this means that every column's constrain should be separated by a comma.

but when I create the table:
CREATE TABLE person ( person_id SERIAL CONSTRAINT pk__person__person_id PRIMARY KEY
, guarantor integer CONSTRAINT fk__person__person_id REFERENCES person(person_id)
, firstname varchar(32) CONSTRAINT nn__person__firstname NOT NULL , CONSTRAINT u__person__firstname UNIQUE
, lastname varchar(32) CONSTRAINT nn__person__lastname NOT NULL
, email varchar(64) CONSTRAINT u__person__email UNIQUE
, phone varchar(32) CONSTRAINT u__person__phone UNIQUE);
I get: ERROR: parser: parse error at or near ","

and when I replace in the firstname definition the `,' between the two constraint by a ` ' : it works !
CREATE TABLE person ( person_id SERIAL CONSTRAINT pk__person__person_id PRIMARY KEY
, guarantor integer CONSTRAINT fk__person__person_id REFERENCES person(person_id)
, firstname varchar(32) CONSTRAINT nn__person__firstname NOT NULL CONSTRAINT u__person__firstname UNIQUE
, lastname varchar(32) CONSTRAINT nn__person__lastname NOT NULL
, email varchar(64) CONSTRAINT u__person__email UNIQUE
, phone varchar(32) CONSTRAINT u__person__phone UNIQUE);

Am'I interpreting wrongly the documentation or ... am'I right : )

Regards

Cedric BRINER
---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Nov 23 '05 #1
4 1186
BRINER Cedric <wo**@infomaniak.ch> writes:
{ /column_name/ /data_type/ [ DEFAULT /default_expr/ ] [ /column_constraint/ [, ... ] ] so this means that every column's constrain should be separated by a comma.


This typo is corrected in the 7.4 docs.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

Nov 23 '05 #2
BRINER Cedric <wo**@infomaniak.ch> writes:
{ /column_name/ /data_type/ [ DEFAULT /default_expr/ ] [ /column_constraint/ [, ... ] ] so this means that every column's constrain should be separated by a comma.


This typo is corrected in the 7.4 docs.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

Nov 23 '05 #3

On Tue, 4 May 2004, BRINER Cedric wrote:
CREATE [ [ LOCAL ] { TEMPORARY | TEMP } ] TABLE /table_name/ (
{ /column_name/ /data_type/ [ DEFAULT /default_expr/ ] [ /column_constraint/ [, ... ] ]
| /table_constraint/ } [, ... ]
)
[ INHERITS ( /parent_table/ [, ... ] ) ]
[ WITH OIDS | WITHOUT OIDS ]


What version are you doing this on? 7.4 seems to not have a comma there.

---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match

Nov 23 '05 #4

On Tue, 4 May 2004, BRINER Cedric wrote:
CREATE [ [ LOCAL ] { TEMPORARY | TEMP } ] TABLE /table_name/ (
{ /column_name/ /data_type/ [ DEFAULT /default_expr/ ] [ /column_constraint/ [, ... ] ]
| /table_constraint/ } [, ... ]
)
[ INHERITS ( /parent_table/ [, ... ] ) ]
[ WITH OIDS | WITHOUT OIDS ]


What version are you doing this on? 7.4 seems to not have a comma there.

---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match

Nov 23 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Jeff Skeith | last post: by
1 post views Thread by Hema Sekhar | last post: by
11 posts views Thread by Daniel E. Fisher | last post: by
4 posts views Thread by Rajesh Kumar Mallah | last post: by
reply views Thread by BRINER Cedric | last post: by
reply views Thread by Google Mike | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.