Re: pg_stop_backup() v2 incorrectly marked as proretset

Поиск
Список
Период
Сортировка
От Chapman Flack
Тема Re: pg_stop_backup() v2 incorrectly marked as proretset
Дата
Msg-id 621FA3BB.4090509@anastigmatix.net
обсуждение исходный текст
Ответ на pg_stop_backup() v2 incorrectly marked as proretset  (Michael Paquier <michael@paquier.xyz>)
Ответы Re: pg_stop_backup() v2 incorrectly marked as proretset  (David Steele <david@pgmasters.net>)
Re: pg_stop_backup() v2 incorrectly marked as proretset  (Michael Paquier <michael@paquier.xyz>)
Список pgsql-hackers
On 03/02/22 02:46, Michael Paquier wrote:
> system function marked as proretset while it builds and returns only
> one record.  And this is a popular one: pg_stop_backup(), labelled
> v2.

I had just recently noticed that while reviewing [0], but shrugged,
as I didn't know what the history was.

Is this best handled as a separate patch, or folded into [0], which is
going to be altering and renaming that function anyway?


On 03/02/22 09:31, Robert Haas wrote:
> On Wed, Mar 2, 2022 at 5:25 AM Aleksander Alekseev
>> Since it doesn't seem to be used for anything except these two array
>> declarations I suggest keeping simply "3" here.
>
> I think we do this kind of thing in various places in similar
> situations, and I think it is good style. It makes it easier to catch
> everything if you ever need to update the code.


I've been known (in other projects) to sometimes accomplish the same
thing with, e.g.,

Datum  values[3];
bool    nulls[sizeof values / sizeof *values];


Doesn't win any beauty contests, but just one place to change the length
if it needs changing. I see we define a lengthof in c.h, so could use:

Datum  values[3];
bool    nulls[lengthof(values)];

Regards,
-Chap


[0] https://commitfest.postgresql.org/37/3436/



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Greg Stark
Дата:
Сообщение: Re: Commitfest 2022-03 Patch Triage Part 1a.i
Следующее
От: Bharath Rupireddy
Дата:
Сообщение: Re: pg_walinspect - a new extension to get raw WAL data and WAL stats