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

Re: LIMIT 1 FOR UPDATE or FOR UPDATE LIMIT 1?

From: Vivek Khera <khera(at)kcilink(dot)com>
To: pgman(at)candle(dot)pha(dot)pa(dot)us (Bruce Momjian)
Subject: Re: LIMIT 1 FOR UPDATE or FOR UPDATE LIMIT 1?
Date: 2002-08-28 15:28:21
Message-ID: x7n0r7huju.fsf@onceler.kciLink.com (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-sql
>>>>> "BM" == Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:

BM> OK, no one has commented on this, so I guess I am going to have to guess
BM> the group's preference.

BM> My guess, seeing as very few probably use LIMIT and FOR UPDATE together,
BM> is to swap them and document it in the release notes.  Was I correct in
BM> my guess?

My preference is to allow both orders for one release, then only allow
the "correct" order in the next.  be sure to absolutely make this a
big red notice in the changelog.

I just scanned my main app and found two instances where I use FOR
UPDATE LIMIT 1.  These are trivial to change, but difficult to do at
the same moment I update the db server.  One of these I probably don't
even need the LIMIT...

-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Vivek Khera, Ph.D.                Khera Communications, Inc.
Internet: khera(at)kciLink(dot)com       Rockville, MD       +1-240-453-8497
AIM: vivekkhera Y!: vivek_khera   http://www.khera.org/~vivek/

In response to

pgsql-hackers by date

Next:From: D'Arcy J.M. CainDate: 2002-08-28 16:48:19
Subject: Re: MemoryContextAlloc: invalid request size 1934906735
Previous:From: Gavin SherryDate: 2002-08-28 14:57:01
Subject: Re: tell Bugtraq about 7.2.2

pgsql-sql by date

Next:From: Kevin BrannenDate: 2002-08-28 16:09:27
Subject: Re: [SQL] Retrieving the new "nextval" for primary keys....
Previous:From: Bruce MomjianDate: 2002-08-28 15:09:42
Subject: Re: SERIAL parameters

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