Re: OID use

Поиск
Список
Период
Сортировка
От Peter Mount
Тема Re: OID use
Дата
Msg-id Pine.LNX.4.21.0010091235250.772-100000@maidast.demon.co.uk
обсуждение исходный текст
Ответ на OID use  (Jeff Davis <jdavis@genesiswd.com>)
Список pgsql-general
On Thu, 5 Oct 2000, Jeff Davis wrote:

> Here is essentially what I am trying to do:
>
> I want to have a 'serial' type column, so that it provides a unique
> identifier for records. However, when I do the insert, I need the know
> what value was assigned to that so I can use it in another table for
> reference, by doing another insert.

When you have used your SERIAL, the currval() function holds the last
value inserted. It's the only way to guarantee getting the correct value,
especially when there's multiple sessions going on.

Peter

--
Peter T Mount peter@retep.org.uk http://www.retep.org.uk
PostgreSQL JDBC Driver http://www.retep.org.uk/postgres/
Java PDF Generator http://www.retep.org.uk/pdf/



В списке pgsql-general по дате отправления:

Предыдущее
От: Peter Mount
Дата:
Сообщение: Re: OIDs and JDBC
Следующее
От: Peter Mount
Дата:
Сообщение: Re: OIDs and JDBC