From: Tom Lane <tgl@sss.pgh.pa.us>
To: Bruce Momjian <pgman@candle.pha.pa.us>
Cc: Jan Wieck <JanWieck@Yahoo.com>
Cc: magnus.enbom@rockstorm.se
Cc: pgsql-sql@postgresql.org
Subject: Re: LIMIT 1 FOR UPDATE or FOR UPDATE LIMIT 1?
Date: Mon, 26 Aug 2002 15:01:37 -0400
Message-ID: <1823.1030388497@sss.pgh.pa.us> (raw)
In-Reply-To: <200208261853.g7QIrjP16253@candle.pha.pa.us>
References: <200208261853.g7QIrjP16253@candle.pha.pa.us>
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> I think FOR UPDATE looks more correct at the end because it
> controls the visibility of the returned result, while LIMIT and the
> other previous clauses control the result. FOR UPDATE clearly has a
> different effect than LIMIT, GROUP BY, WHERE, and the other previous
> clauses, so it makes more sense to me to have it at the end.
In the current implementation, FOR UPDATE acts after LIMIT does, so
putting it last would make sense --- SQL's optional clauses for SELECT
generally act left-to-right.
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: tgl@sss.pgh.pa.us, pgman@candle.pha.pa.us, JanWieck@Yahoo.com, magnus.enbom@rockstorm.se
Subject: Re: LIMIT 1 FOR UPDATE or FOR UPDATE LIMIT 1?
In-Reply-To: <1823.1030388497@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox