Serial data type - Mailing list pgsql-novice

From Walker, Jed S
Subject Serial data type
Date
Msg-id 41669DC6FE3B80449A33A4DD46DB370A09E7EA01@entcoexch15.broadband.att.com
Whole thread Raw
Responses Re: [despammed] Serial data type  (Andreas Kretschmer <akretschmer@despammed.com>)
Re: Serial data type  (Michael Fuhr <mike@fuhr.org>)
List pgsql-novice

I have several tables that require auto-generated Ids. I have noticed the serial and bigserial data types (or pseudo-types). These seem like they make things much simpler, but if you use this, how can you find out the the value of the serial column after you insert a row? Do you have to lookup the primary key or is it stored in a session variable or some other place?  Is it better to define the sequence manually and just select it out by hand before doing the insert?

Thanks,

      Jed S. Walker

pgsql-novice by date:

Previous
From: Michael Fuhr
Date:
Subject: Re: error handling
Next
From: Michael Fuhr
Date:
Subject: Re: Problems on "copy" statement