mirror of
https://github.com/postgres/postgres.git
synced 2025-07-28 23:42:10 +03:00
postgres_fdw: Add connection status check to postgres_fdw_get_connections().
This commit extends the postgres_fdw_get_connections() function to check if connections are closed. This is useful for detecting closed postgres_fdw connections that could prevent successful transaction commits. Users can roll back transactions immediately upon detecting closed connections, avoiding unnecessary processing of failed transactions. This feature is available only on systems supporting the non-standard POLLRDHUP extension to the poll system call, including Linux. Author: Hayato Kuroda Reviewed-by: Shinya Kato, Zhihong Yu, Kyotaro Horiguchi, Andres Freund Reviewed-by: Onder Kalaci, Takamichi Osumi, Vignesh C, Tom Lane, Ted Yu Reviewed-by: Katsuragi Yuta, Peter Smith, Shubham Khanna, Fujii Masao Discussion: https://postgr.es/m/TYAPR01MB58662809E678253B90E82CE5F5889@TYAPR01MB5866.jpnprd01.prod.outlook.com
This commit is contained in:
@ -9,8 +9,9 @@ ALTER EXTENSION postgres_fdw DROP FUNCTION postgres_fdw_get_connections ();
|
||||
/* Then we can drop it */
|
||||
DROP FUNCTION postgres_fdw_get_connections ();
|
||||
|
||||
CREATE FUNCTION postgres_fdw_get_connections (OUT server_name text,
|
||||
OUT valid boolean, OUT used_in_xact boolean)
|
||||
CREATE FUNCTION postgres_fdw_get_connections (
|
||||
IN check_conn boolean DEFAULT false, OUT server_name text,
|
||||
OUT valid boolean, OUT used_in_xact boolean, OUT closed boolean)
|
||||
RETURNS SETOF record
|
||||
AS 'MODULE_PATHNAME', 'postgres_fdw_get_connections_1_2'
|
||||
LANGUAGE C STRICT PARALLEL RESTRICTED;
|
||||
|
Reference in New Issue
Block a user