currval() within one statement - Mailing list pgsql-sql

From silly_sad
Subject currval() within one statement
Date
Msg-id 4795984E.7030904@bankir.ru
Whole thread Raw
Responses Re: currval() within one statement
Re: currval() within one statement
List 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 by date:

Previous
From: Steve Midgley
Date:
Subject: Re: improvements to query with hierarchical elements
Next
From: "A. Kretschmer"
Date:
Subject: Re: currval() within one statement