From: | BRINER Cedric <work(at)infomaniak(dot)ch> |
---|---|
To: | postgres <pgsql-general(at)postgresql(dot)org> |
Subject: | pgsql documentation error ? |
Date: | 2004-05-04 06:59:54 |
Message-ID: | 40973F6A.8080600@infomaniak.ch |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
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
From | Date | Subject | |
---|---|---|---|
Next Message | BRINER Cedric | 2004-05-04 07:06:15 | create synopsis wrong ? |
Previous Message | Michelle Konzack | 2004-05-04 06:28:06 | Re: Pop 3 Emails to Postgresql |