Re: currval() in insert statements

Поиск
Список
Период
Сортировка
От Raymond O'Donnell
Тема Re: currval() in insert statements
Дата
Msg-id 4996F2EC.5080709@iol.ie
обсуждение исходный текст
Ответ на currval() in insert statements  (Onno Molenkamp <onno@flox.org>)
Список pgsql-general
On 14/02/2009 11:25, Onno Molenkamp wrote:
> I recently upgraded a database from 8.1.11 to 8.3.6, and I noticed the
> following statement stopped working:
>
>   insert into test (b) select currval('test_a_seq'::regclass)

I don't think this was ever guaranteed to work - the docs say pretty
clearly that nextval() has to be called before currval() can be expected
to be defined. My feeling is that is was just good fortune that it
worked for you before.

Ray.

------------------------------------------------------------------
Raymond O'Donnell, Director of Music, Galway Cathedral, Ireland
rod@iol.ie
Galway Cathedral Recitals: http://www.galwaycathedral.org/recitals
------------------------------------------------------------------

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

Предыдущее
От: Oleg Bartunov
Дата:
Сообщение: Re: select max from subquery
Следующее
От: Tom Lane
Дата:
Сообщение: Re: trigger creation error (tsvector_update_trigger)