Re: DELETE WHERE EXISTS unexpected results

From: Jasen Betts <jasen(at)xnet(dot)co(dot)nz>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: DELETE WHERE EXISTS unexpected results
Date: 2010-12-02 07:47:09
Message-ID: id7itt$69m$3@reversiblemaps.ath.cx
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On 2010-11-30, Jeff Bland <bland(at)us(dot)ibm(dot)com> wrote:
> This is a multipart message in MIME format.
> --=_alternative 007A6509852577EB_=
> Content-Type: text/plain; charset="US-ASCII"
>
> I want to delete certain rows from table USER_TBL.
> Two tables are involved. USER_TBL and OWNER_TBL.

delete ... using was invented for this purpose.

> In the end I expect the USER_TBL to not contain the 3 HOME entries.
> But what is happening is the whole USER_TBL is empty after the query.

your subselect is being effected by the table used in the delete.

--
⚂⚃ 100% natural

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Humair Mohammed 2010-12-02 21:45:21 COPY with FORMAT in Postgresql 9.x
Previous Message Jeff Bland 2010-12-01 15:07:16 Re: DELETE WHERE EXISTS unexpected results