From: Fujii Masao <fujii@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: plpgsql: Clarify the LIMIT 1 example in the too-many-rows hint
Date: Mon, 16 Nov 2026 02:06:59 +0000
Message-ID: <E1xSm7X-00000000rfB-1nFP@gemulon.postgresql.org> (raw)
plpgsql: Clarify the LIMIT 1 example in the too-many-rows hint
The hint for queries returning more than one row suggested using LIMIT 1,
but it was also shown for commands such as UPDATE ... RETURNING, which
do not support that clause.
Reword the hint to use LIMIT 1 with SELECT as an example, retaining
concrete advice for SELECT queries without suggesting that LIMIT 1
can be used with every command.
Author: Jeevan Chalke <jeevan.chalke@enterprisedb.com>
Reviewed-by: Fujii Masao <masao.fujii@gmail.com>
Discussion: https://postgr.es/m/CAHGQGwH2xDa7CqHkKZfiWQ9+waBdUm8Vh6Br2XNMAiG3vi-hQQ@mail.gmail.com
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/60cdae088b6d86e38059c32a0a1fd66e46de2389
Modified Files
--------------
src/pl/plpgsql/src/pl_exec.c | 2 +-
src/test/regress/expected/plpgsql.out | 16 ++++++++--------
2 files changed, 9 insertions(+), 9 deletions(-)
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: fujii@postgresql.org
Subject: Re: pgsql: plpgsql: Clarify the LIMIT 1 example in the too-many-rows hint
In-Reply-To: <E1xSm7X-00000000rfB-1nFP@gemulon.postgresql.org>
References: <E1xSm7X-00000000rfB-1nFP@gemulon.postgresql.org>
* 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