Skip site navigation (1) Skip section navigation (2)

Re: create table error

From: Michael Glaesemann <grzm(at)myrealbox(dot)com>
To: Kumar S <ps_postgres(at)yahoo(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: create table error
Date: 2004-09-13 13:43:23
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-novice
On Sep 13, 2004, at 10:35 PM, Kumar S wrote:
> create table contacts
> (
>      con_id    serial   ,
>      exp_id    serial   REFERENCES experiment,
>      con_lname  varchar(32) ,
>      con_fname  varchar(32) ,
>      con_addressline  varchar (64),
>      con_zip    varchar(16)  ,
> );
> Is there some problem with these sql statements.

Yes. You have an extra comma following the line beginning con_zip. The 
last line of the table definition should not be followed by a comma.

I suspect you're also going to have trouble with the exp_id serial 
references experiment line. You probably don't want a default on a 
column that needs to match a value in another table.

Hope that helps.

Also, please do not start a new thread by replying to a different 
message. Create a new message instead.

Michael Glaesemann
grzm myrealbox com

In response to

pgsql-novice by date

Next:From: Devrim GUNDUZDate: 2004-09-13 13:43:38
Subject: Re: create table error
Previous:From: Kumar SDate: 2004-09-13 13:35:02
Subject: Re: create table error

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group