X-Original-To: pgsql-bugs-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 2260DD1C516 for ; Tue, 24 Feb 2004 02:09:06 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 38597-02 for ; Mon, 23 Feb 2004 22:09:03 -0400 (AST) Received: from wolff.to (wolff.to [66.93.249.74]) by svr1.postgresql.org (Postfix) with SMTP id 41097D1BA4C for ; Mon, 23 Feb 2004 22:08:59 -0400 (AST) Received: (qmail 15597 invoked by uid 500); 24 Feb 2004 02:11:17 -0000 Date: Mon, 23 Feb 2004 20:11:17 -0600 From: Bruno Wolff III To: PostgreSQL Bugs List Subject: Re: BUG #1083: Insert query reordering interacts badly with NEXTVAL()/CURRVAL() Message-ID: <20040224021117.GA29715@wolff.to> Mail-Followup-To: PostgreSQL Bugs List References: <20040224012657.B86E5CF4A21@www.postgresql.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040224012657.B86E5CF4A21@www.postgresql.com> User-Agent: Mutt/1.5.6i X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200402/117 X-Sequence-Number: 7905 On Mon, Feb 23, 2004 at 21:26:57 -0400, PostgreSQL Bugs List 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.