Skip site navigation (1) Skip section navigation (2)

Re: Implementation of LIMIT on DELETE and UPDATE statements

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Yury Bokhoncovich <byg(at)center-f1(dot)ru>
Cc: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>,Alvaro Herrera <alvherre(at)atentus(dot)com>,"Stephen R(dot) van den Berg" <srb(at)cuci(dot)nl>, pgsql-patches(at)postgresql(dot)org
Subject: Re: Implementation of LIMIT on DELETE and UPDATE statements
Date: 2002-09-23 13:34:22
Message-ID: 20865.1032788062@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-patches
Yury Bokhoncovich <byg(at)center-f1(dot)ru> writes:
> Imagine typical usage of LIMIT/OFFSET: pagination of a web-output.
> Say, the output is fetched thru "select id,body from articles limit 10
> offset 20".
> Now, content-admin, surfing the content and looking to the page say 2,
> wanna drop all info on THAT page 2.
> Guess how it could ease the life for programmer?8)

Only until the first time he drops the wrong page that way.

The above is really a perfect example of why this feature isn't safe:
it would lead people to make unwarranted assumptions.  The fact that
such-and-such a tuple appeared second in the output of LIMIT 10 OFFSET
20 does *not* mean that it would be selected by LIMIT 1 OFFSET 21.  The
planner is entitled to (and often does) choose different query plans
depending on the limit/offset values.

			regards, tom lane

In response to

Responses

pgsql-patches by date

Next:From: Tom LaneDate: 2002-09-23 13:41:40
Subject: Re: DROP COLUMN misbehaviour with multiple inheritance
Previous:From: Hannu KrosingDate: 2002-09-23 09:54:41
Subject: Re: DROP COLUMN misbehaviour with multiple inheritance

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group