currval() within one statement

Поиск
Список
Период
Сортировка
От silly_sad
Тема currval() within one statement
Дата
Msg-id 4795984E.7030904@bankir.ru
обсуждение исходный текст
Ответы Re: currval() within one statement  ("A. Kretschmer" <andreas.kretschmer@schollglas.com>)
Re: currval() within one statement  (hubert depesz lubaczewski <depesz@depesz.com>)
Список pgsql-sql
Helo

is it expected that the currval() changes its value between calls within 
one statement ?

Look the following call:

INSERT INTO ttt (a,b) SELECT currval('ttt_id_seq'), 'const' FROM ttt2;

Where the trigger before insert on ttt is defined and this trigger calls  nextval('ttt_id_seq').

I was surprised having different values of currval() in ttt.a

Is this the normal behavior ? Where is it described ?


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

Предыдущее
От: Steve Midgley
Дата:
Сообщение: Re: improvements to query with hierarchical elements
Следующее
От: "A. Kretschmer"
Дата:
Сообщение: Re: currval() within one statement