pgsql: postgres_fdw: Extend postgres_fdw_get_connections to return user

From: Fujii Masao <fujii(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: postgres_fdw: Extend postgres_fdw_get_connections to return user
Date: 2024-09-18 03:52:43
Message-ID: E1sqlkB-001azR-Ec@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

postgres_fdw: Extend postgres_fdw_get_connections to return user name.

This commit adds a "user_name" output column to
the postgres_fdw_get_connections function, returning the name
of the local user mapped to the foreign server for each connection.
If a public mapping is used, it returns "public."

This helps identify postgres_fdw connections more easily,
such as determining which connections are invalid, closed,
or used within the current transaction.

No extension version bump is needed, as commit c297a47c5f
already handled it for v18~.

Author: Hayato Kuroda
Reviewed-by: Fujii Masao
Discussion: https://postgr.es/m/b492a935-6c7e-8c08-e485-3c1d64d7d10f@oss.nttdata.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/4f08ab55457751308ffd8d33e82155758cd0e304

Modified Files
--------------
contrib/postgres_fdw/connection.c | 57 ++++++++++++++++++++-----
contrib/postgres_fdw/expected/postgres_fdw.out | 16 ++++---
contrib/postgres_fdw/postgres_fdw--1.1--1.2.sql | 3 +-
contrib/postgres_fdw/sql/postgres_fdw.sql | 8 ++--
doc/src/sgml/postgres-fdw.sgml | 23 +++++++---
5 files changed, 81 insertions(+), 26 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Michael Paquier 2024-09-18 05:46:17 pgsql: Add some sanity checks in executor for query ID reporting
Previous Message Michael Paquier 2024-09-18 03:48:20 pgsql: Extend PgStat_HashKey.objid from 4 to 8 bytes