From: Fujii Masao <fujii@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: postgres_fdw: Add "used_in_xact" column to postgres_fdw_get_conn
Date: Fri, 26 Jul 2024 13:17:56 +0000
Message-ID: <E1sXKpY-001JRo-C3@gemulon.postgresql.org> (raw)
postgres_fdw: Add "used_in_xact" column to postgres_fdw_get_connections().
This commit extends the postgres_fdw_get_connections() function to
include a new used_in_xact column, indicating whether each connection
is used in the current transaction.
This addition is particularly useful for the upcoming feature that
will check if connections are closed. By using those information,
users can verify if postgres_fdw connections used in a transaction
remain open. If any connection is closed, the transaction cannot
be committed successfully. In this case users can roll back it
immediately without waiting for transaction end.
The SQL API for postgres_fdw_get_connections() is updated by
this commit and may change in the future. To handle compatibility
with older SQL declarations, an API versioning system is introduced,
allowing the function to behave differently based on the API version.
Author: Hayato Kuroda
Reviewed-by: Fujii Masao
Discussion: https://postgr.es/m/be9382f7-5072-4760-8b3f-31d6dffa8d62@oss.nttdata.com
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/c297a47c5f8da78d976e8c3f790dbeeb6a21a853
Modified Files
--------------
contrib/postgres_fdw/Makefile | 2 +-
contrib/postgres_fdw/connection.c | 82 ++++++++++++++++++++++---
contrib/postgres_fdw/expected/postgres_fdw.out | 8 +--
contrib/postgres_fdw/meson.build | 1 +
contrib/postgres_fdw/postgres_fdw--1.1--1.2.sql | 16 +++++
contrib/postgres_fdw/postgres_fdw.control | 2 +-
doc/src/sgml/postgres-fdw.sgml | 21 +++++--
7 files changed, 112 insertions(+), 20 deletions(-)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-committers@postgresql.org
Cc: fujii@postgresql.org, pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: postgres_fdw: Add "used_in_xact" column to postgres_fdw_get_conn
In-Reply-To: <E1sXKpY-001JRo-C3@gemulon.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox