Re: allow LIMIT in UPDATE and DELETE

From: Csaba Nagy <nagy(at)ecircle-ag(dot)com>
To: SCassidy(at)overlandstorage(dot)com
Cc: Postgres general mailing list <pgsql-general(at)postgresql(dot)org>, pgsql-general-owner(at)postgresql(dot)org
Subject: Re: allow LIMIT in UPDATE and DELETE
Date: 2006-05-19 15:54:13
Message-ID: 1148054053.17461.437.camel@coppola.muc.ecircle.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, 2006-05-19 at 17:43, SCassidy(at)overlandstorage(dot)com wrote:
> Regarding Oracle's ROWNUM - since they have to use that instead of OFFSET
> and LIMIT, that isn't much of an argument for the Oracle way. When
> converting queries into Oracle SQL, I always _really_ miss OFFSET and
> LIMIT. They are much easier to use than ROWNUM, especially with ORDER BY.

I would agree here, but for my purpose would have been a lot easier to
parameterize the limit syntax only than to completely rewrite the query
for postgres.

> I think that more databases support OFFSET and LIMIT than ROWNUM (the
> Oracle way).
I actually don't care what's the syntax as long I can create a query
with the syntactically equivalent parts in the same place of the query
and the same number and order of parameters. Then it's fairly easy to
parameterize it and have the same code handle it... otherwise I have to
write special code for each data base. Sometimes I have to do that
anyway for different reasons, but it is a PITA to maintain it, so I try
to minimize the number of places where I have to do it.

> Personally, I have never wanted a DELETE or UPDATE with LIMIT. The one
> time I did something similar in Oracle, I used partitions, and just dropped
> or truncated the partition containing the old data.

Perfectly fine, I also don't use many of the features available :-) That
doesn't mean it is not useful for others...

Cheers,
Csaba.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Rafael Martinez 2006-05-19 16:08:05 Re: [GENERAL] Weird ..... (a=1 or a=2) <> (a=2 or a=1)
Previous Message SCassidy 2006-05-19 15:43:43 Re: allow LIMIT in UPDATE and DELETE