| From: | Fujii Masao <masao(dot)fujii(at)gmail(dot)com> |
|---|---|
| To: | Jeevan Chalke <jeevan(dot)chalke(at)enterprisedb(dot)com> |
| Cc: | Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org> |
| Subject: | Re: PL/pgSQL: apply the too_many_rows extra check to EXECUTE ... INTO |
| Date: | 2026-11-03 08:38:46 |
| Message-ID: | CAHGQGwH2xDa7CqHkKZfiWQ9+waBdUm8Vh6Br2XNMAiG3vi-hQQ@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
On Tue, Nov 3, 2026 at 4:27 PM Jeevan Chalke
<jeevan(dot)chalke(at)enterprisedb(dot)com> wrote:
> Thanks for the review, Pavel, and for marking it Ready for Committer.
Since the patch was marked Ready for Committer, I've just started reading it.
+ If the command string contains more than one SQL command, only the
+ result of the last one is assigned to the <literal>INTO</literal>
+ variable(s); the results of the earlier commands are discarded.
This does not seem to be always true. If the last command is an INSERT with
an unconditional DO INSTEAD NOTHING rule, the result of the preceding
SELECT is used instead. Is that right?
Also, since this describes existing behavior, isn't it better to leave this
paragraph out of the patch and address it separately?
> + errhint("Make sure the query returns a single row, or use LIMIT 1.")));
LIMIT 1 is not applicable to every command, such as UPDATE ... RETURNING.
So,perhaps it's better to remove "or use LIMIT 1" from the hint? But, since
the same issue seems to exist for static SQL, that might need to be addressed
in a separate patch anyway.
Regards,
--
Fujii Masao
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Mahendrakar Srinivasarao | 2026-11-03 09:37:46 | Re: [PATCH] doc: Fix description of relative extension "directory" setting |
| Previous Message | Masahiko Sawada | 2026-11-03 08:17:09 | Re: Proposal: Conflict log history table for Logical Replication |