Re: [BUGS] BUG #1083: Insert query reordering interacts badly with NEXTVAL()/CURRVAL()

2004-06-07 Thread Tom Lane
"Martin Langhoff (Catalyst IT)" <[EMAIL PROTECTED]> writes: > Thanks for the clarification. I am curious, however: I can't find a > means to achieve the same effect in a deterministic manner. Any pointers? How about SELECT nextval('seq'); -- ignore result INSERT INTO ... VALUES (currval('

Re: [BUGS] BUG #1083: Insert query reordering interacts badly with NEXTVAL()/CURRVAL()

2004-06-07 Thread Tom Lane
"PostgreSQL Bugs List" <[EMAIL PROTECTED]> writes: > /* 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')); This is not a bug. The order of evaluation of select-lis

Re: [BUGS] BUG #1083: Insert query reordering interacts badly with

2004-02-27 Thread Bruno Wolff III
I am going to try to move this over the sql list, since it doesn't belong on bugs. On Tue, Feb 24, 2004 at 23:47:48 +1300, Martin Langhoff <[EMAIL PROTECTED]> wrote: > Tom Lane wrote: > > >How about > > > >SELECT nextval('seq'); -- ignore result > > > >INSERT INTO ... VALUES (currval('seq

Re: [BUGS] BUG #1083: Insert query reordering interacts badly with

2004-02-26 Thread Martin Langhoff (Catalyst IT)
Tom Lane wrote: "PostgreSQL Bugs List" <[EMAIL PROTECTED]> writes: /* 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')); This is not a bug. The order of evalua

Re: [BUGS] BUG #1083: Insert query reordering interacts badly with

2004-02-26 Thread Martin Langhoff
Tom Lane wrote: How about SELECT nextval('seq'); -- ignore result INSERT INTO ... VALUES (currval('seq'), currval('seq')); Well, it works for my sample case, I have to agree. Maybe I should mention that I tried to boil down the bugreport to the simplest repro case I could. My actual

Re: [BUGS] BUG #1083: Insert query reordering interacts badly with NEXTVAL()/CURRVAL()

2004-02-23 Thread Bruno Wolff III
On Mon, Feb 23, 2004 at 21:26:57 -0400, PostgreSQL Bugs List <[EMAIL PROTECTED]> 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_

[BUGS] BUG #1083: Insert query reordering interacts badly with NEXTVAL()/CURRVAL()

2004-02-23 Thread PostgreSQL Bugs List
The following bug has been logged online: Bug reference: 1083 Logged by: Martin Langhoff Email address: [EMAIL PROTECTED] PostgreSQL version: 7.4 Operating system: Linux irkutsk 2.4.25-piv-smp-server #1 SMP Fri Feb 20 16:56:47 NZDT 2004 i686 unknown Description: