Re: pg_stop_backup() v2 incorrectly marked as proretset

From: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>
To: michael(at)paquier(dot)xyz
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: pg_stop_backup() v2 incorrectly marked as proretset
Date: 2022-03-02 08:22:35
Message-ID: 20220302.172235.1181597714315490061.horikyota.ntt@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

At Wed, 2 Mar 2022 16:46:01 +0900, Michael Paquier <michael(at)paquier(dot)xyz> wrote in
> 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?

That direction seems find to me.

But the patch forgets to remove an useless variable.

> /* Initialise attributes information in the tuple descriptor */
> tupdesc = CreateTemplateTupleDesc(PG_STOP_BACKUP_V2_COLS);
> TupleDescInitEntry(tupdesc, (AttrNumber) 1, "lsn",
> PG_LSNOID, -1, 0);

I think we can use get_call_resuilt_type here.

regards.

--
Kyotaro Horiguchi
NTT Open Source Software Center

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2022-03-02 08:24:26 Re: Proposal: Support custom authentication methods using hooks
Previous Message Peter Eisentraut 2022-03-02 08:18:17 Re: [PATCH] Expose port->authn_id to extensions and triggers