The following bug has been logged online:

Bug reference:      2789
Logged by:          Lucian Capdefier
Email address:      [EMAIL PROTECTED]
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

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

               http://archives.postgresql.org

Reply via email to