Re: Logging which local address was connected to in log_line_prefix

From: Greg Sabino Mullane <htamfids(at)gmail(dot)com>
To: Jim Jones <jim(dot)jones(at)uni-muenster(dot)de>
Cc: david(at)pgmasters(dot)net, Peter Eisentraut <peter(at)eisentraut(dot)org>, Cary Huang <cary(dot)huang(at)highgo(dot)ca>, "pgsql-hackers(at)lists(dot)postgresql(dot)org" <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Logging which local address was connected to in log_line_prefix
Date: 2025-02-27 13:54:56
Message-ID: CAKAnmmKfXb=yrKfr-n90xh_LdnPygyU6ORpTmxooe0yrHG_8dQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Nov 18, 2024 at 10:07 AM Jim Jones <jim(dot)jones(at)uni-muenster(dot)de>
wrote:

> 2024-11-18 16:00:42.720 CET [3135117] -> 192.168.178.27 STATEMENT:
> ...
> 2024-11-18 16:01:23.273 CET [3114980] -> [local] LOG: received SIGHUP,
> ...

2024-11-18 16:01:46.769 CET [3114981] -> [local] LOG: checkpoint
> Is it supposed to be like this?
>

Great question. I think "supposed to" is a bit of a stretch, but I presume
it's the difference between a client connecting and using its connection
information versus an already existing backend process, which is always
going to be "local".

Overall this makes sense, as that checkpoint example above is coming from
the checkpointer background process at 3114981, not the backend process
that happened to trigger it. And 3114981 has no way of knowing the details
of the caller's connection.

FWIW, the patch still applies cleanly to head as of 2/27/2025, so no rebase
needed.

Cheers,
Greg

--
Crunchy Data - https://www.crunchydata.com
Enterprise Postgres Software Products & Tech Support

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2025-02-27 14:04:03 Re: Add -k/--link option to pg_combinebackup
Previous Message Daniel Gustafsson 2025-02-27 13:38:24 Re: Serverside SNI support in libpq