Re: Efficient DELETE Strategies

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Christoph Haller <ch(at)rodos(dot)fzk(dot)de>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Efficient DELETE Strategies
Date: 2002-06-11 14:28:40
Message-ID: 18946.1023805720@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Christoph Haller <ch(at)rodos(dot)fzk(dot)de> writes:
> Christopher Kings-Lynne wrote:
>> DELETE [LOW_PRIORITY | QUICK] table_name[.*] [,table_name[.*] ...]
>> FROM table-references
>> [WHERE where_definition]
>>
>> or
>>
>> DELETE [LOW_PRIORITY | QUICK]
>> FROM table_name[.*], [table_name[.*] ...]
>> USING table-references
>> [WHERE where_definition]
>>
>> The idea is that only matching rows from the tables listed before the FROM
>> or before the USING clause are deleted. The effect is that you can delete
>> rows from many tables at the same time and also have additional tables that
>> are used for searching.

> Sounds tempting. It is much more what I was asking for.
> Is there a collision with USING ( join_column_list ) ?

Good point --- that was a very poor choice of keyword by the MySQL guys.

I have absolutely no intention of getting into this "delete from
multiple tables" business --- I don't understand the semantics it should
have, and it would probably not be easy to do inside Postgres anyway.

It would seem that

DELETE [ FROM ] relation_expr [ alias_clause ]
[ FROM from_list ] where_clause

is the syntax that would be most nearly compatible with MSSQL and MySQL.
Does Oracle have anything comparable?

regards, tom lane

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Olaf Frączyk 2002-06-11 15:19:55 Unicode and escaping single quotes
Previous Message Christoph Haller 2002-06-11 11:18:34 Re: Efficient DELETE Strategies