From: | Charles Tassell <ctassell(at)isn(dot)net> |
---|---|
To: | pgsql-general(at)postgreSQL(dot)org |
Subject: | Re: [GENERAL] serial type |
Date: | 1999-09-28 06:15:32 |
Message-ID: | 4.1.19990928031028.00942ba0@mailer.isn.net |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
What is the syntax you are using for the insert?
This:
INSERT INTO comment VALUES (, 'Example');
or this
INSERT INTO comment (rec_id, locale) VALUES (, 'Example');
won't work. You have to *specifically* leave out the sequence field in
your field list, like this:
INSERT INTO comment (locale) VALUES ('Example');
It works the same for any default value, which is basically what a sequence
is (type sequence = int default nextval('sequence') )
At 01:45 AM 9/28/99, Greg Beams wrote:
>I'm trying to create a table as such:
>
>create table comment
>(rec_id serial,
>locale varchar(50),
>...)
>
>It creates correctly, telling me that it will create an implicit sequence
>for the serial column, and an implicit index for the table. But, when I
>try to insert a record into the database (without specifying the value for
>the rec_id column) I get the following error:
>
>ERROR: serial.nextval: sequence does not exist
>
>Does anyone have any ideas (I'm not sure whether this belongs on this
>list, or the pgsql-sql list)?
>
>Thanks, Greg.
>
>Greg Beams - gob(at)students(dot)cs(dot)mu(dot)oz(dot)au
>
>I'M NOT OKAY, YOU'RE NOT OKAY--BUT, HEY, THAT'S OKAY.
>
>
>************
>
From | Date | Subject | |
---|---|---|---|
Next Message | Holger Klawitter | 1999-09-28 08:09:11 | 6.5.2 unter Solaris 2.6 feedback |
Previous Message | greg | 1999-09-28 05:23:19 | Re: [GENERAL] backend crashing with INTERSECT / ORDER BY |