From: Tom Lane <tgl@sss.pgh.pa.us>
To: Bruce Momjian <pgman@candle.pha.pa.us>
Cc: Hannu Krosing <hannu@tm.ee>
Cc: Christoph Haller <ch@rodos.fzk.de>
Cc: pgsql-sql@postgresql.org
Cc: pgsql-hackers@postgresql.org
Subject: Re: [HACKERS] Efficient DELETE Strategies
Date: Mon, 10 Jun 2002 16:34:01 -0400
Message-ID: <8490.1023741241@sss.pgh.pa.us> (raw)
In-Reply-To: <200206101833.g5AIXj600263@candle.pha.pa.us>
References: <200206101833.g5AIXj600263@candle.pha.pa.us>
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> Hannu Krosing wrote:
>> What about
>>
>> DELETE relation_expr FROM relation_expr [ , table_ref [ , ... ] ]
>> [ WHERE bool_expr ]
>>
>> or
>>
>> DELETE relation_expr.* FROM relation_expr [ , table_ref [ , ... ] ]
>> [ WHERE bool_expr ]
> So make the initial FROM optional and allow the later FROM to be a list
> of relations? Seems kind of strange.
No, I think he's suggesting that one be able to pick out any element of
the FROM-list and say that that is the deletion target. I really don't
want to get into that (unless there is precedent in Oracle or
someplace); it seems way too confusing to me. It would also force us to
do error checking to eliminate cases that ought to just be syntactically
impossible: target table not present, target is a join or subselect
instead of a table, target is on wrong side of an outer join, etc.
[ and in another message ]
> The FROM ... FROM looks weird, and there is clearly confusion over the
> FROM t1, t2. I wish there was another option.
The only other thing that's come to mind is to use a different keyword
(ie, not FROM) for the list of auxiliary relations. WITH might work
from a simple readability point of view:
DELETE FROM target WITH other-tables WHERE ...
But we've already got FROM as the equivalent construct in UPDATE, so it
seems weird to use something else in DELETE.
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: tgl@sss.pgh.pa.us, pgman@candle.pha.pa.us, hannu@tm.ee, ch@rodos.fzk.de, pgsql-hackers@postgresql.org
Subject: Re: [HACKERS] Efficient DELETE Strategies
In-Reply-To: <8490.1023741241@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox