pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: silly_sad <sad@bankir.ru>
To: pgsql-sql@postgresql.org
Subject: currval() within one statement
Date: Tue, 22 Jan 2008 10:16:30 +0300
Message-ID: <4795984E.7030904@bankir.ru> (raw)

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 ?



view thread (11+ messages)  latest in thread

Message-ID: <4795984E.7030904@bankir.ru>
Permalink:  ../4795984E.7030904@bankir.ru/
Also on:    postgresql.org/message-id/4795984E.7030904@bankir.ru

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: sad@bankir.ru
  Subject: Re: currval() within one statement
  In-Reply-To: <4795984E.7030904@bankir.ru>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox