Re: BUG #5233: delete wrong doing with subquery where condition

From: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
To: Fred Wei <weif(at)niwa(dot)co(dot)nz>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #5233: delete wrong doing with subquery where condition
Date: 2009-12-04 07:21:22
Message-ID: 4B18B872.4040103@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Fred Wei wrote:
> cod_old=# delete from tmp where k in (select k from tmp2);
> DELETE 1
> --this is wrong, because k does not exist in tmp2!

That behavior is correct, k is referring to tmp.k. See
http://archives.postgresql.org/message-id/200910160726.n9G7QEEg097413@wwwmaster.postgresql.org

This should be added to the FAQ...

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2009-12-04 16:46:57 Re: ossp/uuid.h error during configure of 8_3_STABLE
Previous Message Nasby, Jim 2009-12-04 06:24:39 ossp/uuid.h error during configure of 8_3_STABLE