pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bruce Momjian <pgman@candle.pha.pa.us>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Christoph Haller <ch@rodos.fzk.de>
Cc: pgsql-sql@postgresql.org
Cc: pgsql-hackers@postgresql.org
Subject: Re: Efficient DELETE Strategies
Date: Mon, 10 Jun 2002 12:48:16 -0400 (EDT)
Message-ID: <200206101648.g5AGmG419376@candle.pha.pa.us> (raw)
In-Reply-To: <5619.1023717387@sss.pgh.pa.us>

Tom Lane wrote:
> Christoph Haller <ch@rodos.fzk.de> writes:
> 
> 	DELETE FROM relation_expr [ FROM table_ref [ , ... ] ]
> 	[ WHERE bool_expr ]
> 
> The two FROMs in the second form look a little weird, but they help to
> make a clear separation between the deletion target table and the
> merely-referenced tables.  Also, the first one might look to people
> like they'd be allowed to write
> 
> 	DELETE FROM foo FULL JOIN bar ...
> 
> which is not any part of my intention (it's very unclear what it'd
> mean for the target table to be on the nullable side of an outer join).
> OTOH there'd be no harm in outer joins in a separate from-clause, eg
> 
> 	DELETE FROM foo FROM (bar FULL JOIN baz ON ...) WHERE ...
> 
> Actually, either syntax above would support that; I guess what's really
> bothering me about the first syntax is that a comma suggests a list of
> things that will all be treated similarly, while in reality the first
> item will be treated much differently from the rest.

Interesting.  We could allow an alias on the primary table:

	DELETE FROM foo f
	WHERE

and allow the non-alias version of the table for the join.  Of course,
that doesn't allow "FULL JOIN" and stuff like that.  The FROM ... FROM
looks weird, and there is clearly confusion over the FROM t1, t2.  I
wish there was another option.

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026



view thread (21+ messages)  latest in thread

Message-ID: <200206101648.g5AGmG419376@candle.pha.pa.us>
Permalink:  ../200206101648.g5AGmG419376@candle.pha.pa.us/
Also on:    postgresql.org/message-id/200206101648.g5AGmG419376@candle.pha.pa.us

 · 

reply

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: pgman@candle.pha.pa.us, tgl@sss.pgh.pa.us, ch@rodos.fzk.de, pgsql-hackers@postgresql.org
  Subject: Re: Efficient DELETE Strategies
  In-Reply-To: <200206101648.g5AGmG419376@candle.pha.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