Obtaining value of last serial column after insert - Mailing list pgsql-general

From Shane Wegner
Subject Obtaining value of last serial column after insert
Date
Msg-id 20011113170017.A11240@cm.nu
Whole thread Raw
List pgsql-general
Hi all,

I have read about this topic in the FAQ but am hoping I can
get a bit more help obtaining the last inserted serial
column.  My program can use Mysql and Pgsql interchangeably
and I am looking for something which does what
the mysql_insert_id() function does. .

The problem with using curval() and nextval() in pgsql is
that it requires one to know the name of the sequence field
in the database.  Is there a way to use the oid to select
the primary key from a table without knowing the name of
the column?

Thanks in advance,
Shane


--
Shane Wegner: shane@cm.nu
              http://www.cm.nu/~shane/
PGP:          1024D/FFE3035D
              A0ED DAC4 77EC D674 5487
              5B5C 4F89 9A4E FFE3 035D

pgsql-general by date:

Previous
From: "Glen Parker"
Date:
Subject: Re: CREATE DATABASE WITH LOCATION
Next
From: "Scott Muir"
Date:
Subject: Vacuuming - how often?