Received: from c006.snv.cp.net (c006-h003.c006.snv.cp.net [209.228.33.159]) by postgresql.org (Postfix) with SMTP id A02BB47510B for ; Wed, 27 Feb 2002 02:38:50 -0500 (EST) Received: (cpmta 29478 invoked from network); 26 Feb 2002 23:38:56 -0800 Date: 26 Feb 2002 23:38:56 -0800 Message-ID: <20020227073856.29477.cpmta@c006.snv.cp.net> X-Sent: 27 Feb 2002 07:38:56 GMT Received: from [66.108.148.98] by mail.ivillage.com with HTTP; 26 Feb 2002 23:38:56 PST Content-Type: text/plain Content-Disposition: inline Mime-Version: 1.0 To: pgsql-sql@postgresql.org From: otisg@ivillage.com X-Mailer: Web Mail 3.9.3.5 X-Sent-From: otisg@ivillage.com Subject: INSERT requires SERIAL column? X-Archive-Number: 200202/424 X-Sequence-Number: 6845 Hello, I've got a table with these columns: user_id SERIAL CONSTRAINT pk_user_auth_user_id PRIMARY KEY, email VARCHAR(64) NOT NULL UNIQUE , password VARCHAR(16) NOT NULL , status SMALLINT NOT NULL DEFAULT 1 But when I tried using the following INSERT statement I got an error about not being able to parse the input. INSERT INTO user_auth VALUES ('foo@example.com', 'password', 1); psql:../data/user_auth.dat:13: ERROR: pg_atoi: error in "foo@example.com": can't parse "foo@example.com" So this indicates that an integer was expected as the first value. In order to get it to do what I want I had to use this: INSERT INTO user_auth VALUES (nextval('user_auth_user_id_seq'), 'foo@example.com', 'password', 1); Question: Is this really necessary or am I missing something? I thought specifying SERIAL columns is not neccessary in INSERT statements. Thank you, Otis _________________________________________________________________ iVillage.com: Solutions for Your Life Check out the most exciting women's community on the Web http://www.ivillage.com