pg_stop_backup() v2 incorrectly marked as proretset - Mailing list pgsql-hackers

From Michael Paquier
Subject pg_stop_backup() v2 incorrectly marked as proretset
Date
Msg-id Yh8guT78f1Ercfzw@paquier.xyz
Whole thread Raw
Responses Re: pg_stop_backup() v2 incorrectly marked as proretset  (Kyotaro Horiguchi <horikyota.ntt@gmail.com>)
Re: pg_stop_backup() v2 incorrectly marked as proretset  (Chapman Flack <chap@anastigmatix.net>)
List pgsql-hackers
Hi all,

In my hunt looking for incorrect SRFs, I have noticed a new case of a
system function marked as proretset while it builds and returns only
one record.  And this is a popular one: pg_stop_backup(), labelled
v2.

This leads to a lot of unnecessary work, as the function creates a
tuplestore it has no need for with the usual set of checks related to
SRFs.  The logic can be be simplified as of the attached.

Thoughts?
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: Masahiko Sawada
Date:
Subject: Re: Add the replication origin name and commit-LSN to logical replication worker errcontext
Next
From: Andres Freund
Date:
Subject: Re: Design of pg_stat_subscription_workers vs pgstats