Re: Implementation of LIMIT on DELETE and UPDATE statements - Mailing list pgsql-patches

From Bruce Momjian
Subject Re: Implementation of LIMIT on DELETE and UPDATE statements
Date
Msg-id 200209230312.g8N3ChC05510@candle.pha.pa.us
Whole thread Raw
In response to Re: Implementation of LIMIT on DELETE and UPDATE statements (rel to 7.2.1)  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Implementation of LIMIT on DELETE and UPDATE statements  (Yury Bokhoncovich <byg@center-f1.ru>)
List pgsql-patches
Tom Lane wrote:
> > srb@cuci.nl (Stephen R. van den Berg) escribi�:
> >> Incidentally, using a SELECT without an ORDER BY but with a LIMIT is
> >> documented to give unpredictable results, yet users are expected cope with
> >> this fact, but are expected to have problems with a similar fact in
> >> an UPDATE or DELETE statement?
>
> Well, IMHO there's a big difference in documented unpredictable output
> from a documented-unpredictable query, as opposed to
> documented-unpredictable changes in the database state.  There is not
> a lot of use for the latter AFAICS.
>
> Alvaro Herrera <alvherre@atentus.com> writes:
> > as I already said, the feature has some value with the ORDER BY added,
> > and the LIMIT/OFFSET thing expanded to allow expressions (this last part
> > is in TODO).
>
> I'd have more confidence in the usefulness of the idea if it included
> ORDER BY to make the LIMIT predictable.  But before you run off and
> implement that: does MySQL support such a thing?  If not, the argument
> of improving compatibility still doesn't hold any water...

I see no reason to add stuff to UPDATE/DELETE when a subquery does the
job just as well.  It just seems like bloat.

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

pgsql-patches by date:

Previous
From: Tom Lane
Date:
Subject: Re: Implementation of LIMIT on DELETE and UPDATE statements (rel to 7.2.1)
Next
From: Yury Bokhoncovich
Date:
Subject: Re: Implementation of LIMIT on DELETE and UPDATE statements