pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bruce Momjian <pgman@candle.pha.pa.us>
To: Manfred Koizar <mkoi-pg@aon.at>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Christoph Haller <ch@rodos.fzk.de>
Cc: pgsql-sql@postgresql.org
Subject: Re: Efficient DELETE Strategies
Date: Wed, 12 Jun 2002 12:36:36 -0400 (EDT)
Message-ID: <200206121636.g5CGaaR04976@candle.pha.pa.us> (raw)
In-Reply-To: <es9eguk7ov9644qo4qd341ess8ip8o51ok@4ax.com>

Manfred Koizar wrote:
> On Tue, 11 Jun 2002 10:28:40 -0400, Tom Lane <tgl@sss.pgh.pa.us>
> wrote:
> >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?
> 
> Oracle basically supports (with slight variations between releases
> 7/8/9):
> 	DELETE [FROM] { table
> 	              | view
> 	              | ( subquery )
> 	              }
> 	       [alias] [WHERE ...] [returning_clause]
> 
> Informix (March 1997, 9.1?):
> 	DELETE FROM { table
> 	            | ONLY ( table )
> 	            | view
>                     | synonym
> 	            | collection_derived_table
> 	            }
> 	       WHERE condition
> 
> According to the "SQL Quick Syntax Guide" the WHERE clause is not
> optional.  Does anybody know, if this is a documentation bug?
> "Guide to SQL, Syntax" (Feb 1998, v7.3, v8.2) says, the WHERE clause
> is optional, as we'd expect.

Informix in dbaccess prompts you if you do a DELETE with no WHERE to
make sure it is what you want, if I remember correctly.  In app code,
the WHERE is optional.  At least that is how I remember it.

-- 
  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: <200206121636.g5CGaaR04976@candle.pha.pa.us>
Permalink:  ../200206121636.g5CGaaR04976@candle.pha.pa.us/
Also on:    postgresql.org/message-id/200206121636.g5CGaaR04976@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, mkoi-pg@aon.at, tgl@sss.pgh.pa.us, ch@rodos.fzk.de
  Subject: Re: Efficient DELETE Strategies
  In-Reply-To: <200206121636.g5CGaaR04976@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