Obtaining value of last serial column after insert

Поиск
Список
Период
Сортировка
От Shane Wegner
Тема Obtaining value of last serial column after insert
Дата
Msg-id 20011113170017.A11240@cm.nu
обсуждение исходный текст
Список 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 по дате отправления:

Предыдущее
От: "Glen Parker"
Дата:
Сообщение: Re: CREATE DATABASE WITH LOCATION
Следующее
От: "Scott Muir"
Дата:
Сообщение: Vacuuming - how often?