Re: Create table & serial question

From: Dror Matalon <dror(at)zapatec(dot)com>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Create table & serial question
Date: 2002-11-18 19:52:10
Message-ID: 20021118195210.GV43588@four.zapatec.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Just do

INSERT INTO ROUTE VALUES('10/10/1999') ;

It will automatically populate the next value.

On Mon, Nov 18, 2002 at 08:30:13PM +0100, Alex Dovlecel wrote:
> Hello all
> If this is too trivial... sorry. :o(((
>
> I have created a table with the following command:
>
> CREATE TABLE ROUTE
> (
> ID SERIAL ,
> START DATE ,
> PRIMARY KEY ( ID )
> ) ;
>
> And it worked just fine. But if I call:
> INSERT INTO ROUTE VALUES(10, '10/10/1999') ;
> it ads a record but the id is 10. Is this the correct behaviour for the
> SERIAL type? I was hoping it will be 1 and ignore the one that I set.
>
> If this is the normal behaviour, how can I make it ignore the 10 and place
> the next id?
>
> Tx
> dovle
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
> message can get through to the mailing list cleanly

--
Dror Matalon
Zapatec Inc
1700 MLK Way
Berkeley, CA 94709
http://www.zapatec.com

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Felipe Schnack 2002-11-18 20:49:37 Re: default values
Previous Message Alex Dovlecel 2002-11-18 19:30:13 Create table & serial question