BUG #2789: problem with delete statement - Mailing list pgsql-bugs

From Lucian Capdefier
Subject BUG #2789: problem with delete statement
Date
Msg-id 200611280021.kAS0LRHI063899@wwwmaster.postgresql.org
Whole thread Raw
Responses Re: BUG #2789: problem with delete statement
List pgsql-bugs
The following bug has been logged online:

Bug reference:      2789
Logged by:          Lucian Capdefier
Email address:      luciancapdefier@gmail.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

pgsql-bugs by date:

Previous
From: Chris Jones
Date:
Subject: Re: BUG #2769: "invalid memory alloc request size " on
Next
From: "Shawn Tayler"
Date:
Subject: BUG #2788: Create Function operator Broken?