Re: [HACKERS] [SQL] Efficient DELETE Strategies

2002-08-26 Thread Bruce Momjian
Added to TODO: * Allow DELETE to handle table aliases for self-joins [delete] --- Manfred Koizar wrote: > On Mon, 10 Jun 2002 09:56:27 -0400, Tom Lane <[EMAIL PROTECTED]> > wrote: > >Does anyone know whether other

Re: [HACKERS] [SQL] Efficient DELETE Strategies

2002-06-11 Thread Hannu Krosing
On Tue, 2002-06-11 at 04:53, Bruce Momjian wrote: > Tom Lane wrote: > > Bruce Momjian <[EMAIL PROTECTED]> writes: > > > Hannu Krosing wrote: > > >> What about > > >> > > >> DELETE relation_expr FROM relation_expr [ , table_ref [ , ... ] ] > > >> [ WHERE bool_expr ] > > >> > > >> or > > >> > > >

Re: [HACKERS] [SQL] Efficient DELETE Strategies

2002-06-10 Thread Christopher Kings-Lynne
> Given the plethora of mutually incompatible interpretations that MSSQL > evidently supports, though, I fear we can't use it as precedent for > making any choices :-(. > > Can anyone check out other systems? MySQL: 6.4.6 DELETE Syntax DELETE [LOW_PRIORITY | QUICK] FROM table_name [WHERE

Re: [HACKERS] [SQL] Efficient DELETE Strategies

2002-06-10 Thread Bruce Momjian
Tom Lane wrote: > Bruce Momjian <[EMAIL PROTECTED]> 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 [ , ... ] ] >

Re: [HACKERS] [SQL] Efficient DELETE Strategies

2002-06-10 Thread Barry Lind
This Hannu Krosing wrote: > DELETE relation_expr FROM relation_expr [ , table_ref [ , ... ] ] > [ WHERE bool_expr ] This in some ways is similar to Oracle where the FROM is optional in a DELETE (ie. DELETE foo WHERE ...). By omitting the first FROM, the syntax ends up mirroring the UPD

Re: [HACKERS] [SQL] Efficient DELETE Strategies

2002-06-10 Thread Dann Corbit
> -Original Message- > From: Josh Berkus [mailto:[EMAIL PROTECTED]] > Sent: Monday, June 10, 2002 3:42 PM > To: Tom Lane; Manfred Koizar > Cc: Christoph Haller; [EMAIL PROTECTED]; > [EMAIL PROTECTED] > Subject: Re: [HACKERS] [SQL] Efficient DELETE Strategies >

Re: [HACKERS] [SQL] Efficient DELETE Strategies

2002-06-10 Thread Josh Berkus
Tom, > >> If so, what's their syntax? > > > MSSQL seems to guess what the user wants. > > Gack. Nothing like treating mindless syntax variations as a "feature" > list... I vote that we stick to a strick SQL92 interpretation, here. 1) It's standard 2) Strict syntax on DELETE statements is

Re: [HACKERS] [SQL] Efficient DELETE Strategies

2002-06-10 Thread Tom Lane
Manfred Koizar <[EMAIL PROTECTED]> writes: >> If so, what's their syntax? > MSSQL seems to guess what the user wants. Gack. Nothing like treating mindless syntax variations as a "feature" list... > All the following statements do the same: > (1) DELETE t1 FROM t2 WHERE t1.i=t2.i > (2a) DELET

Re: [HACKERS] [SQL] Efficient DELETE Strategies

2002-06-10 Thread Tom Lane
Bruce Momjian <[EMAIL PROTECTED]> 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

Re: [HACKERS] [SQL] Efficient DELETE Strategies

2002-06-10 Thread Manfred Koizar
On Mon, 10 Jun 2002 09:56:27 -0400, Tom Lane <[EMAIL PROTECTED]> wrote: >Does anyone know whether other systems that support the UPDATE extension >for multiple tables also support a DELETE extension for multiple tables? >If so, what's their syntax? MSSQL seems to guess what the user wants. All t

Re: [HACKERS] [SQL] Efficient DELETE Strategies

2002-06-10 Thread Bruce Momjian
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 F

Re: [HACKERS] [SQL] Efficient DELETE Strategies

2002-06-10 Thread Bruce Momjian
Tom Lane wrote: > Christoph Haller <[EMAIL PROTECTED]> 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 t

Re: [HACKERS] [SQL] Efficient DELETE Strategies

2002-06-10 Thread Hannu Krosing
On Mon, 2002-06-10 at 15:56, Tom Lane wrote: > Christoph Haller <[EMAIL PROTECTED]> writes: > > Based on an entry in the mailing list from 30 Oct 2001 > > about efficient deletes on subqueries, > > I've found two ways to do so (PostgreSQL 7.2.1): > > ... > > Is there a way to put the second for

Re: [HACKERS] [SQL] Efficient DELETE Strategies

2002-06-10 Thread Tom Lane
Christoph Haller <[EMAIL PROTECTED]> writes: > Based on an entry in the mailing list from 30 Oct 2001 > about efficient deletes on subqueries, > I've found two ways to do so (PostgreSQL 7.2.1): > ... > Is there a way to put the second form (more complicated, but faster) > in one statement? >