Re: problem fetching currval of sequence - Mailing list pgsql-sql

From Josh Berkus
Subject Re: problem fetching currval of sequence
Date
Msg-id 200208061426.58011.josh@agliodbs.com
Whole thread Raw
In response to Re: problem fetching currval of sequence  (Charles Hauser <chauser@duke.edu>)
List pgsql-sql
Charles,

> I know this script worked in the past, but I have not used it
> recently.  We are running PostgreSQL 7.1.3.  It would be great if
> this would work as I have several scripts which operate in a similar
> manner for different TABLES, but if it won't work I'll work around it.
>
> Suggestions for the best way to get the value for the gb_id after an INSERT?

I usually SELECT NEXTVAL(), and then pass that ID number to the INSERT
statement.   It's very reliable.

--
-Josh Berkus

______AGLIO DATABASE SOLUTIONS___________________________                                       Josh Berkus  Complete
informationtechnology     josh@agliodbs.com   and data management solutions     (415) 565-7293  for law firms, small
businesses     fax 621-2533   and non-profit organizations.     San Francisco 



pgsql-sql by date:

Previous
From: Charles Hauser
Date:
Subject: Re: problem fetching currval of sequence
Next
From: "Tom Haddon"
Date:
Subject: ALTER TABLE follow up