Serial data type

From: "Walker, Jed S" <Jed_Walker(at)cable(dot)comcast(dot)com>
To: "'pgsql-novice(at)postgresql(dot)org'" <pgsql-novice(at)postgresql(dot)org>
Subject: Serial data type
Date: 2005-04-13 15:30:09
Message-ID: 41669DC6FE3B80449A33A4DD46DB370A09E7EA01@entcoexch15.broadband.att.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Michael Fuhr 2005-04-13 15:34:42 Re: Problems on "copy" statement
Previous Message Michael Fuhr 2005-04-13 15:16:04 Re: error handling