Re: pg_stop_backup() v2 incorrectly marked as proretset

Поиск
Список
Период
Сортировка
От Robert Haas
Тема Re: pg_stop_backup() v2 incorrectly marked as proretset
Дата
Msg-id CA+Tgmoas049acSuXnvyZjbsGHDjE+uPnj5eNRLYd_yLxyHBVrw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: pg_stop_backup() v2 incorrectly marked as proretset  (Aleksander Alekseev <aleksander@timescale.com>)
Ответы Re: pg_stop_backup() v2 incorrectly marked as proretset
Список pgsql-hackers
On Wed, Mar 2, 2022 at 5:25 AM Aleksander Alekseev
<aleksander@timescale.com> wrote:
> ```
>  Datum
>  pg_stop_backup_v2(PG_FUNCTION_ARGS)
>  {
> -    ReturnSetInfo *rsinfo = (ReturnSetInfo *) fcinfo->resultinfo;
> +#define PG_STOP_BACKUP_V2_COLS 3
>      TupleDesc    tupdesc;
> -    Tuplestorestate *tupstore;
> -    MemoryContext per_query_ctx;
> -    MemoryContext oldcontext;
> -    Datum        values[3];
> -    bool        nulls[3];
> +    Datum        values[PG_STOP_BACKUP_V2_COLS];
> +    bool        nulls[PG_STOP_BACKUP_V2_COLS];
> ```
>
> Declaring a macro inside the procedure body is a bit unconventional.
> 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.

-- 
Robert Haas
EDB: http://www.enterprisedb.com



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

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: PG DOCS - logical replication filtering
Следующее
От: Tom Lane
Дата:
Сообщение: Re: pg_stop_backup() v2 incorrectly marked as proretset