BUG #2789: problem with delete statement

From: "Lucian Capdefier" <luciancapdefier(at)gmail(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #2789: problem with delete statement
Date: 2006-11-28 00:21:27
Message-ID: 200611280021.kAS0LRHI063899@wwwmaster.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs


The following bug has been logged online:

Bug reference: 2789
Logged by: Lucian Capdefier
Email address: luciancapdefier(at)gmail(dot)com
PostgreSQL version: 8.1.5
Operating system: Windows XP
Description: problem with delete statement
Details:

I have noticed a problem with the DELETE statement.

1. I cannot user table alias in the FROM clause of the DELETE statement.
2. I cannot user more than one, table in the FROM clause.

Example:

1.
delete
from fxkanban.product_offer
where offer_id=1 and
exists (select 1 from fxkanban.product_offer x, fxkanban.product p
where x.product_id=p.product_id and
x.offer_id=offer_id and
p.owner='test')
works ok

delete
from fxkanban.product_offer o
where o.offer_id=1 and
exists (select 1 from fxkanban.product_offer x, fxkanban.product p
where x.product_id=p.product_id and
x.offer_id=o.offer_id and
p.owner='test')
does not work

2.
delete
from only fxkanban.product_offer, fxkanban.product p
where o.offer_id=1 and
o.product_id=p.product_id and
p.owner='test'
does not work

Both problems issue SQL Error 42601

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Jeff Davis 2006-11-28 00:46:12 Re: Unexpected sort order.
Previous Message Tom Lane 2006-11-27 22:39:30 Re: Unexpected sort order.