471,073 Members | 1,367 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.

create synopsis wrong ?


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 will mean that every column's constraint will be separated by a `,' !

but when I try to create:
sysobs=# CREATE TABLE person ( person_id SERIAL CONSTRAINT pk__person__person_id PRIMARY KEY
sysobs(# , guarantor integer CONSTRAINT fk__person__person_id REFERENCES person(person_id)
sysobs(# , firstname varchar(32) CONSTRAINT nn__person__firstname NOT NULL , CONSTRAINT u__person__firstname UNIQUE
sysobs(# , lastname varchar(32) CONSTRAINT nn__person__lastname NOT NULL
sysobs(# , email varchar(64) CONSTRAINT u__person__email UNIQUE
sysobs(# , phone varchar(32) CONSTRAINT u__person__phone UNIQUE);
ERROR: parser: parse error at or near ","
this is what I've got !
So I've I removed the `,' between the two column's constraint :
sysobs=# CREATE TABLE person ( person_id SERIAL CONSTRAINT pk__person__person_id PRIMARY KEY
sysobs(# , guarantor integer CONSTRAINT fk__person__person_id REFERENCES person(person_id)
sysobs(# , firstname varchar(32) CONSTRAINT nn__person__firstname NOT NULL CONSTRAINT u__person__firstname UNIQUE
sysobs(# , lastname varchar(32) CONSTRAINT nn__person__lastname NOT NULL
sysobs(# , email varchar(64) CONSTRAINT u__person__email UNIQUE
sysobs(# , phone varchar(32) CONSTRAINT u__person__phone UNIQUE);
...
...
CREATE
and !bam! it works !

So is my interpretation of the synopsis wrong or is'it the synopsis itself which is wrong ?

Regards

Cédric BRINER

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Nov 23 '05 #1
0 978

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Steven T. Hatton | last post: by
6 posts views Thread by Mabden | last post: by
3 posts views Thread by Miguel Dias Moura | last post: by
reply views Thread by BRINER Cedric | last post: by
9 posts views Thread by mvsguy | last post: by
reply views Thread by leo001 | 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.