Re: Make set_ps_display faster and easier to use

Поиск
Список
Период
Сортировка
От David Rowley
Тема Re: Make set_ps_display faster and easier to use
Дата
Msg-id CAApHDvrx-kwtWFaO8_hxS5fBYeAe-Rp0YWATZSwBJx8UVu9bJA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Make set_ps_display faster and easier to use  (Andres Freund <andres@anarazel.de>)
Ответы Re: Make set_ps_display faster and easier to use  (David Rowley <dgrowleyml@gmail.com>)
Список pgsql-hackers
Thank you for having a look at this.

On Fri, 17 Feb 2023 at 14:01, Andres Freund <andres@anarazel.de> wrote:
> > +set_ps_display_suffix(const char *suffix)
> > +{
> > +     size_t  len;
>
> Think this will give you an unused-variable warning in the PS_USE_NONE case.

Fixed

> > +#ifndef PS_USE_NONE
> > +     /* update_process_title=off disables updates */
> > +     if (!update_process_title)
> > +             return;
> > +
> > +     /* no ps display for stand-alone backend */
> > +     if (!IsUnderPostmaster)
> > +             return;
> > +
> > +#ifdef PS_USE_CLOBBER_ARGV
> > +     /* If ps_buffer is a pointer, it might still be null */
> > +     if (!ps_buffer)
> > +             return;
> > +#endif
>
> This bit is now repeated three times. How about putting it into a helper?

Good idea. Done.

> > +set_ps_display_internal(void)
>
> Very very minor nit: Perhaps this should be update_ps_display() or
> flush_ps_display() instead?

I called the precheck helper update_ps_display_precheck(), so went
with flush_ps_display() for updating the display so they both didn't
start with "update".

Updated patch attached.

David

Вложения

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

Предыдущее
От: Katsuragi Yuta
Дата:
Сообщение: Re: [Proposal] Add foreign-server health checks infrastructure
Следующее
От: Etsuro Fujita
Дата:
Сообщение: Doc: Improve note about copying into postgres_fdw foreign tables in batch