Re: How to find LIMIT in SQL standard

Поиск
Список
Период
Сортировка
От Christopher Browne
Тема Re: How to find LIMIT in SQL standard
Дата
Msg-id m3brtc470p.fsf@wolfe.cbbrowne.com
обсуждение исходный текст
Ответ на How to find LIMIT in SQL standard  (Rory Campbell-Lange <rory@campbell-lange.net>)
Список 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 по дате отправления:

Предыдущее
От: Bryant M
Дата:
Сообщение: career in SQL/Database administration
Следующее
От: Evil Azrael
Дата:
Сообщение: BSD License