pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Cc: sawada.mshk@gmail.com
Cc: exclusion@gmail.com
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #17789: process_pgfdw_appname() fails for autovacuum workers
Date: Mon, 20 Feb 2023 16:59:25 +0900
Message-ID: <Y/MoXUbuZty59gFj@paquier.xyz> (raw)
In-Reply-To: <20230215.161254.1131534874642120926.horikyota.ntt@gmail.com>
References: <17789-8b31c5a4672b74d9@postgresql.org>
	<20230214.140544.79456937383215325.horikyota.ntt@gmail.com>
	<CAD21AoArqZMZO71jPsO7HwtzKCykpW0Qvt3vSzjR+Qo0Gvx1bg@mail.gmail.com>
	<20230215.161254.1131534874642120926.horikyota.ntt@gmail.com>

On Wed, Feb 15, 2023 at 04:12:54PM +0900, Kyotaro Horiguchi wrote:
> By the way, when we designed that part, we first concluded that the
> user name and database name cannot be NULL before we later concluded
> that MyProcPort cannot be NULL. However, log_status_format() takes
> into account the case where MyProcPort stores NULL as user and
> database names.  Do you think we should still ignore the case of NULL
> user name and database names, even though our assumption about
> MyProcPort was found to be incorrect? In that case,
> log_status_format() replaces, for example, %u with '[unknown]'.

Hmm.  I think that I would play it safe but consistent here for %d and
%u as this code could be triggered in various contexts as far as I
understand:
- When MyProcPort is NULL, insert no data, because there is nothing to
report.
- When MyProcPort is not NULL but the %d or %u field is NULL, use
[unknown], because we just don't know what to show up, still there is
a MyProcPort.

This has the advantage to be able to make the difference in both
cases, which could be important for the end-user depending on the
context where the code is run.
--
Michael

Attachments:

  signature.asc (application/pgp-signature, 832B) download

view thread (11+ messages)  latest in thread

Message-ID: <Y/MoXUbuZty59gFj@paquier.xyz>
Permalink:  ../Y%2FMoXUbuZty59gFj@paquier.xyz/
Also on:    postgresql.org/message-id/Y/MoXUbuZty59gFj@paquier.xyz

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: michael@paquier.xyz, horikyota.ntt@gmail.com, sawada.mshk@gmail.com, exclusion@gmail.com, pgsql-bugs@lists.postgresql.org
  Subject: Re: BUG #17789: process_pgfdw_appname() fails for autovacuum workers
  In-Reply-To: <Y/MoXUbuZty59gFj@paquier.xyz>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox