473,320 Members | 2,035 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 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 1260
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Jeff Skeith | last post by:
first, i would like the thoughts of some folks with more experience than i have. i want to learn pgsql. i have some vb and msaccess experience and would like to learn how to use php and pgsql...
1
by: Hema Sekhar | last post by:
Hi I am Hemasekhar K.P I am trying to replicae pgsql on REDHATLinux 8, but the site http://gborg.postgresql.org/genpage?replication_72install. is giving instructions on REDHATLinux 7, is there...
1
by: pgsql-ml | last post by:
Hello, Since it's not possible to do a function with a variable number of arguments, I am wondering if it is possible to use an array as an argument in a PL/PGSQL function ? CREATE OR REPLACE...
11
by: Daniel E. Fisher | last post by:
> I can't get a rest for a min guys. > > I go away for the weekend and my server is getting this error. > > Fatal error: Call to undefined function: pg_connect() in >...
4
by: Rajesh Kumar Mallah | last post by:
Hi, We need to implement following logic efficiently. SELECT * from some_table where .... IF rows_matched = 1 THEN use the single row that matched.
0
by: BRINER Cedric | last post by:
Synopsis CREATE { TEMPORARY | TEMP } ] TABLE /table_name/ ( { /column_name/ /data_type/ ] | /table_constraint/ } ) ) ] so this means that every column's constrain should be...
4
by: Postgresql | last post by:
Hello, I am unable to get on many of the postgresql mailing lists. I usually get this message back with no attachment and no email comes afterwards with a confirmation. I've tried this over and...
0
by: Google Mike | last post by:
I had RH9 Linux. It came with pgSQL, but I couldn't seem to figure out how to get PL/pgSQL going. I read the HTML documentation that came with it and was confused until I tried a few different...
1
by: sysxperts | last post by:
Hello, Having an issue that is specific to PHP compiled with PGSQL support with versions noted in subject line. I understand that there are many variables to consider here but believe I have...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.