pg_stop_backup() v2 incorrectly marked as proretset

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Postgres hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: pg_stop_backup() v2 incorrectly marked as proretset
Date: 2022-03-02 07:46:01
Message-ID: Yh8guT78f1Ercfzw@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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 Content-Type Size
stopbackup-no-srf.patch text/x-diff 4.0 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2022-03-02 07:56:15 Re: Design of pg_stat_subscription_workers vs pgstats
Previous Message Masahiko Sawada 2022-03-02 07:34:59 Re: Add the replication origin name and commit-LSN to logical replication worker errcontext