Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search archives
  Advanced Search

currval() within one statement


  • From: silly_sad <sad(at)bankir(dot)ru>
  • To: pgsql-sql(at)postgresql(dot)org
  • Subject: currval() within one statement
  • Date: Tue, 22 Jan 2008 10:16:30 +0300
  • Message-id: <4795984E.7030904@bankir.ru> <text/plain>

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 ?



Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group