Re: How to find LIMIT in SQL standard - Mailing list pgsql-general

From Christopher Browne
Subject Re: How to find LIMIT in SQL standard
Date
Msg-id m3brtc470p.fsf@wolfe.cbbrowne.com
Whole thread Raw
In response to How to find LIMIT in SQL standard  (Rory Campbell-Lange <rory@campbell-lange.net>)
List pgsql-general
In an attempt to throw the authorities off his trail, rory@campbell-lange.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/>

pgsql-general by date:

Previous
From: Bryant M
Date:
Subject: career in SQL/Database administration
Next
From: Evil Azrael
Date:
Subject: BSD License