[BUGS] Bug #704: dump/restore bug

2002-07-08 Thread pgsql-bugs
Andre Schroeter ([EMAIL PROTECTED]) reports a bug with a severity of 2 The lower the number the more severe it is. Short Description dump/restore bug Long Description dear postgres developers, i have just noticed a big problem with dump/restore from version 6.5.3 to 7.2. but i think it is not v

Re: [BUGS] INSERT .. SELECT should redo SELECT if a duplicate key is found

2002-07-08 Thread Cesar Eduardo Barros
On Sat, Jul 06, 2002 at 12:18:56PM -0300, wrote: > > When you are trying to insert a row in a table with a UNIQUE constraint, > unless it already exists, you can try something like: > > INSERT INTO table (id) SELECT val WHERE NOT EXISTS (SELECT 1 FROM table WHERE id = >val) > > However, this

[BUGS] INSERT .. SELECT should redo SELECT if a duplicate key is found

2002-07-08 Thread Cesar Eduardo Barros
When you are trying to insert a row in a table with a UNIQUE constraint, unless it already exists, you can try something like: INSERT INTO table (id) SELECT val WHERE NOT EXISTS (SELECT 1 FROM table WHERE id = val) However, this does not work as expected if another backend inserts a row with th

[BUGS] Move constant evaluation to inside IN subselect

2002-07-08 Thread Cesar Eduardo Barros
constant IN (SELECT col FROM ...) and EXISTS (SELECT col FROM ... WHERE col = constant) are equivalent. Moving the constant to inside the subquery can make a big difference. teste=# create table teste (id integer primary key); NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index 'teste