pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bruno Wolff III <bruno@wolff.to>
To: PostgreSQL Bugs List <pgsql-bugs@postgresql.org>
Subject: Re: BUG #1083: Insert query reordering interacts badly with NEXTVAL()/CURRVAL()
Date: Mon, 23 Feb 2004 20:11:17 -0600
Message-ID: <20040224021117.GA29715@wolff.to> (raw)
In-Reply-To: <20040224012657.B86E5CF4A21@www.postgresql.com>
References: <20040224012657.B86E5CF4A21@www.postgresql.com>

On Mon, Feb 23, 2004 at 21:26:57 -0400,
  PostgreSQL Bugs List <pgsql-bugs@postgresql.org> wrote:
> 
> Details: 
> 
> === SQL ===
> 
> CREATE TEMP TABLE testing (col_a integer, col_b integer);
> CREATE TEMP SEQUENCE seq;
> 
> /* this statement will produce the expected result */
> INSERT INTO testing (col_a, col_b) VALUES (NEXTVAL('seq'), CURRVAL('seq'));
> 
> /* this statement will reverse the order of CURRVAL()/NEXTVAL() to match the 
> column order of the table */ 
> INSERT INTO testing (col_b, col_a) VALUES (NEXTVAL('seq'), CURRVAL('seq'));

I don't think an order of evaluation is guarenteed for INSERT VALUE lists.



view thread (7+ messages)  latest in thread

Message-ID: <20040224021117.GA29715@wolff.to>
Permalink:  ../20040224021117.GA29715@wolff.to/
Also on:    postgresql.org/message-id/20040224021117.GA29715@wolff.to

 · 

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: bruno@wolff.to, pgsql-bugs@postgresql.org
  Subject: Re: BUG #1083: Insert query reordering interacts badly with NEXTVAL()/CURRVAL()
  In-Reply-To: <20040224021117.GA29715@wolff.to>

* 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