Re: How I can read-back a serial value just inserted?

Поиск
Список
Период
Сортировка
Искать
От
Russ Brown
Тема
Re: How I can read-back a serial value just inserted?
Дата
Msg-id
45AF99F4.3070608@gmail.com
Ответ на
Список
Дерево обсуждения
How I can read-back a serial value just inserted? "dfx" <dfx@dfx.it>
Re: How I can read-back a serial value just inserted? "Adam Rich" <adam.r@sbcglobal.net>
Re: How I can read-back a serial value just inserted? Robert Treat <xzilla@users.sourceforge.net>
Re: How I can read-back a serial value just inserted? Russ Brown <pickscrape@gmail.com>
Re: How I can read-back a serial value just inserted? Devrim GUNDUZ <devrim@CommandPrompt.com>
Re: How I can read-back a serial value just inserted? Bruno Wolff III <bruno@wolff.to>
Re: How I can read-back a serial value just inserted? Madison Kelly <linux@alteeve.com>
Robert Treat wrote:
> On Thursday 18 January 2007 00:57, Adam Rich wrote:
>> If it's a recent PG:
>>
>> select lastval()
>>
>> See this:
>>
>> http://www.postgresql.org/docs/8.2/interactive/functions-sequence.html
>>
> 
> probably more important that you see this:
> http://people.planetpostgresql.org/xzilla/index.php?/archives/169-Is-lastval-evil.html
> 
> :-)
> 

lastval's main benefit is in aiding the port of MySQL apps (being a 
drop-in replacement for LAST_INSERT_ID()). without lastval such ports 
can be really difficult.

So it does have its place. :)
В списке pgsql-general по дате отправления
От: Robert Treat
Дата:
От: Devrim GUNDUZ
Дата:
FAQ