Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id D57231C0B197 for ; Fri, 20 Jul 2012 07:27:58 -0300 (ADT) Received: from plane.gmane.org ([80.91.229.3]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1SsAR8-0002l0-Ju for pgsql-sql@postgresql.org; Fri, 20 Jul 2012 10:27:57 +0000 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1SsAQu-0002XP-H9 for pgsql-sql@postgresql.org; Fri, 20 Jul 2012 12:27:40 +0200 Received: from 217.110.94.67 ([217.110.94.67]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 20 Jul 2012 12:27:40 +0200 Received: from spam_eater by 217.110.94.67 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 20 Jul 2012 12:27:40 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: pgsql-sql@postgresql.org From: Thomas Kellerer Subject: Re: DELETE using an outer join Date: Fri, 20 Jul 2012 12:27:22 +0200 Lines: 18 Message-ID: References: <21289.1342709554@sss.pgh.pa.us> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: 217.110.94.67 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.23) Gecko/20090812 Thunderbird/2.0.0.23 Mnenhy/0.7.6.666 In-Reply-To: X-Pg-Spam-Score: -0.7 (/) X-Archive-Number: 201207/24 X-Sequence-Number: 36761 Sergey Konoplev, 20.07.2012 10:21: > On Thu, Jul 19, 2012 at 6:52 PM, Tom Lane wrote: >>> Now I was wondering if a DELETE statement could be rewritten with the same "strategy": >> >> Not at the moment. There have been discussions of allowing the same >> table name to be respecified in USING, but there are complications. > > However it works. > > DELETE FROM some_table USING some_table AS s > WHERE > some_table.col1 = s.col1 AND > some_table.col2 = s.col2 AND > some_table.id < s.id; > But that's not an outer join