Re: contrib/pg_stat_tcpinfo

From: Jakub Wartak <jakub(dot)wartak(at)enterprisedb(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Cc: Andres Freund <andres(at)anarazel(dot)de>
Subject: Re: contrib/pg_stat_tcpinfo
Date: 2025-11-07 10:36:05
Message-ID: CAKZiRmz6Dv27ECsrb47uQOMkGJcWZre10KNx_T8NzrmV=B2GCQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Nov 3, 2025 at 3:09 PM Jakub Wartak
<jakub(dot)wartak(at)enterprisedb(dot)com> wrote:
>
> Attached is pg_stat_tcpinfo, an heavy work in progress, Linux-only
> netstat/ss-like extension for showing detailed information about TCP
> connections based on information from the kernel itself.
[..]

> Some early feedback about direction in order to bring this into core
> would be appreciated. State of stuff:
>
> 1. Andres is pushing for supporting UNIX domain sockets here, but I'm
> not sure if it is really worth the effort (and it would trigger new
> naming problem;)) and primarily making the code even more complex.
> IMHO the netlinksock_diag API is already convoluted and adding AF_UNIX
> would make it even less readable.
> 2. IPv6 works, but wasn't tested much.
> 3. Biggest TODO left is probably properly formatting the information
> based on struct tcpinfo variables (just like ss(1) does, so keeping
> the same unit/formatting)
> 4. Patch/tests are missing intentionally as I would like first to
> stabilize the outputs/naming/code first.
> 5. [security] Should this be available to pg_monitor/pg_read_all_stats
> or just to superuser?
> 6. [security] Should this return info about all TCP connections or
> just the UID of the postmaster?

v2 attached with tiny fixes and little more code readability (for
dumping struct tcpinfo *)

-J.

Attachment Content-Type Size
v2-0001-pg_stat_tcpinfo.patch text/x-patch 35.0 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Vaibhav Dalvi 2025-11-07 10:42:17 Re: [PATCH] Add pg_get_subscription_ddl() function
Previous Message Xuneng Zhou 2025-11-07 10:10:25 Re: Add tab completion support for WAIT FOR command