Re: Logging which interface was connected to in log_line_prefix

From: Cary Huang <cary(dot)huang(at)highgo(dot)ca>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Cc: Greg Sabino Mullane <htamfids(at)gmail(dot)com>
Subject: Re: Logging which interface was connected to in log_line_prefix
Date: 2024-04-29 23:29:29
Message-ID: 171443336951.1145.12036872617629257418.pgcf@coridan.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

The following review has been posted through the commitfest application:
make installcheck-world: tested, passed
Implements feature: tested, passed
Spec compliant: tested, passed
Documentation: tested, passed

Hi

I did a quick test on this patch and it seems to work as expected. Originally I thought the patch would add the name of "local interface" such as "eth0", "eth1", "lo"... etc as %L log prefix format. Instead, it formats the local interface IP addresses , but I think it is fine too.

I have tested this new addition with various types of IPs including IPv4, IPv4 and IPv6 local loop back addresses, global IPv6 address, linked local IPv6 address with interface specifier, it seems to format these IPs correctly

There is a comment in the patch that states:

/* We do not need clean_ipv6_addr here: just report verbatim */

I am not quite sure what it means, but I am guessing it means that the patch does not need to format the IPv6 addresses in any specific way. For example, removing leading zeros or compressing consecutive zeros to make a IPv6 address shorter. It may not be necessary to indicate this in a comment because In my test, if any of my interface's IPv6 address have consecutive zeroes like this: 2000:0000:0000:0000:0000:0000:200:cafe/64, my network driver (Ubuntu 18.04) will format it as 2000::200:cafe, and the patch of course will read it as 2000::200:cafe, which is ... correct and clean.

thank you
Cary Huang
www.highgo.ca

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2024-04-29 23:50:16 Re: DROP OWNED BY fails to clean out pg_init_privs grants
Previous Message Tom Lane 2024-04-29 23:26:55 Re: DROP OWNED BY fails to clean out pg_init_privs grants