pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Bruno Wolff III <bruno@wolff.to>
Cc: Christoph Haller <ch@rodos.fzk.de>
Cc: pgsql-sql@postgresql.org
Subject: Re: " Adding missing FROM-clause entry for table .... " problem.
Date: Tue, 18 Feb 2003 10:50:25 -0500
Message-ID: <23770.1045583425@sss.pgh.pa.us> (raw)
In-Reply-To: <20030218141243.GA11505@wolff.to>
References: <3E521E3F.C5E4251B@rodos.fzk.de>
	<20030218141243.GA11505@wolff.to>

Bruno Wolff III <bruno@wolff.to> writes:
> Christoph Haller <ch@rodos.fzk.de> wrote:
>> AFAIK, statements like
>> DELETE FROM t1 where t1.id = t2.id ;
>> are legal. Could the parser still work on this, if the feature is
>> removed?

> Only if a new syntax is added.

For UPDATE, we actually do have an extension syntax that allows naming
secondary tables explicitly:

	UPDATE target SET ... FROM other-tables WHERE ...

The trouble with extending this to DELETE is that DELETE already uses
the keyword FROM.  Seems like we are stuck with a choice between

	DELETE FROM target FROM other-tables WHERE ...

	DELETE FROM target, other-tables WHERE ...

both of which are bizarre and confusing to my eyes.  I think that MySQL
uses the second form, which I like even less than the first (it obscures
the very fundamental semantic difference between the deletion target and
the other tables).

Or we could go off with a different keyword, perhaps

	DELETE FROM target WITH other-tables WHERE ...

but that doesn't seem to pass the low-astonishment test either.

Comments?  It would not be difficult to implement any of these
alternatives.  <hhg>okay, you think it's so easy, *you* decide
what color it should be</hhg>

			regards, tom lane



view thread (12+ messages)  latest in thread

Message-ID: <23770.1045583425@sss.pgh.pa.us>
Permalink:  ../23770.1045583425@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/23770.1045583425@sss.pgh.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: tgl@sss.pgh.pa.us, bruno@wolff.to, ch@rodos.fzk.de
  Subject: Re: " Adding missing FROM-clause entry for table .... " problem.
  In-Reply-To: <23770.1045583425@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