Re: Logging which local address was connected to in log_line_prefix - Mailing list pgsql-hackers

From Greg Sabino Mullane
Subject Re: Logging which local address was connected to in log_line_prefix
Date
Msg-id CAKAnmmKfXb=yrKfr-n90xh_LdnPygyU6ORpTmxooe0yrHG_8dQ@mail.gmail.com
Whole thread Raw
In response to Re: Logging which local address was connected to in log_line_prefix  (Jim Jones <jim.jones@uni-muenster.de>)
List pgsql-hackers
On Mon, Nov 18, 2024 at 10:07 AM Jim Jones <jim.jones@uni-muenster.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

--
Enterprise Postgres Software Products & Tech Support

pgsql-hackers by date:

Previous
From: Daniel Gustafsson
Date:
Subject: Re: Serverside SNI support in libpq
Next
From: Robert Haas
Date:
Subject: Re: Add -k/--link option to pg_combinebackup