Re: How to find LIMIT in SQL standard

From: Christopher Browne <cbbrowne(at)acm(dot)org>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: How to find LIMIT in SQL standard
Date: 2003-09-23 01:40:06
Message-ID: m3brtc470p.fsf@wolfe.cbbrowne.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

In an attempt to throw the authorities off his trail, rory(at)campbell-lange(dot)net (Rory Campbell-Lange) transmitted:
> Essentially the call (as defined below) asks for an update and adds
> a LIMIT parameter on the end of the UPDATE. (eg update where x=1
> limit 1). Postgres doesn't like this and I assume it isn't SQL
> standards compliant and need to refer to this in my bug report.

No, it appears to be your understanding of the SQL standards may be a
little bit deficient.

LIMIT is a reserved word in SQL, but its use has not been
standardized. If you use LIMIT, then your query isn't compliant with
the standards, and the bug isn't in PostgreSQL, but rather is in your
code.

And what you are trying to do doesn't seem to make terribly much
sense. It sounds as though you're happy updating any random record so
long as it resembles the ones you think you might be updating.
Perhaps you should use, as search criteria, elements in a unique key,
so that you can be assured that the row will be unique.
--
If this was helpful, <http://svcs.affero.net/rm.php?r=cbbrowne> rate me
http://www.ntlug.org/~cbbrowne/x.html
Rules of the Evil Overlord #90. "I will not design my Main Control
Room so that every workstation is facing away from the door."
<http://www.eviloverlord.com/>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message pginfo 2003-09-23 05:19:07 Re: pg 7.3.4 and linux box crash
Previous Message Mainlander 2003-09-23 00:45:19 TList.Sort