Skip to content

Commit 98dbef9

Browse files
committed
postgres_fdw: Revert unstable tests for postgres_fdw.application_name.
Commit 449ab63 added the tests that check that postgres_fdw.application_name GUC works as expected. But they were unstable and caused some buildfarm members to report the failure. This commit reverts those unstable tests. Reported-by: Tom Lane as per buildfarm Discussion: https://postgr.es/m/3220909.1631054766@sss.pgh.pa.us
1 parent bb1412b commit 98dbef9

File tree

2 files changed

+0
-118
lines changed

2 files changed

+0
-118
lines changed

contrib/postgres_fdw/expected/postgres_fdw.out

Lines changed: 0 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -10761,82 +10761,3 @@ ERROR: invalid value for integer option "fetch_size": 100$%$#$#
1076110761
CREATE FOREIGN TABLE inv_bsz (c1 int )
1076210762
SERVER loopback OPTIONS (batch_size '100$%$#$#');
1076310763
ERROR: invalid value for integer option "batch_size": 100$%$#$#
10764-
-- ===================================================================
10765-
-- test postgres_fdw.application_name GUC
10766-
-- ===================================================================
10767-
-- Turn debug_discard_caches off for this test to make that
10768-
-- the remote connection is alive when checking its application_name.
10769-
-- For each test, close all the existing cached connections manually and
10770-
-- establish connection with new setting of application_name.
10771-
SET debug_discard_caches = 0;
10772-
-- If appname is set as GUC but not as options of server object,
10773-
-- the GUC setting is used as application_name of remote connection.
10774-
SET postgres_fdw.application_name TO 'fdw_guc_appname';
10775-
SELECT 1 FROM postgres_fdw_disconnect_all();
10776-
?column?
10777-
----------
10778-
1
10779-
(1 row)
10780-
10781-
SELECT 1 FROM ft6 LIMIT 1;
10782-
?column?
10783-
----------
10784-
1
10785-
(1 row)
10786-
10787-
SELECT application_name FROM pg_stat_activity
10788-
WHERE application_name IN ('loopback2', 'fdw_guc_appname');
10789-
application_name
10790-
------------------
10791-
fdw_guc_appname
10792-
(1 row)
10793-
10794-
-- If appname is set as options of server object but not as GUC,
10795-
-- appname of server object is used.
10796-
RESET postgres_fdw.application_name;
10797-
ALTER SERVER loopback2 OPTIONS (ADD application_name 'loopback2');
10798-
SELECT 1 FROM postgres_fdw_disconnect_all();
10799-
?column?
10800-
----------
10801-
1
10802-
(1 row)
10803-
10804-
SELECT 1 FROM ft6 LIMIT 1;
10805-
?column?
10806-
----------
10807-
1
10808-
(1 row)
10809-
10810-
SELECT application_name FROM pg_stat_activity
10811-
WHERE application_name IN ('loopback2', 'fdw_guc_appname');
10812-
application_name
10813-
------------------
10814-
loopback2
10815-
(1 row)
10816-
10817-
-- If appname is set both as GUC and as options of server object,
10818-
-- the GUC setting overrides appname of server object and is used.
10819-
SET postgres_fdw.application_name TO 'fdw_guc_appname';
10820-
SELECT 1 FROM postgres_fdw_disconnect_all();
10821-
?column?
10822-
----------
10823-
1
10824-
(1 row)
10825-
10826-
SELECT 1 FROM ft6 LIMIT 1;
10827-
?column?
10828-
----------
10829-
1
10830-
(1 row)
10831-
10832-
SELECT application_name FROM pg_stat_activity
10833-
WHERE application_name IN ('loopback2', 'fdw_guc_appname');
10834-
application_name
10835-
------------------
10836-
fdw_guc_appname
10837-
(1 row)
10838-
10839-
--Clean up
10840-
ALTER SERVER loopback2 OPTIONS (DROP application_name);
10841-
RESET postgres_fdw.application_name;
10842-
RESET debug_discard_caches;

contrib/postgres_fdw/sql/postgres_fdw.sql

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -3422,42 +3422,3 @@ CREATE FOREIGN TABLE inv_fsz (c1 int )
34223422
-- Invalid batch_size option
34233423
CREATE FOREIGN TABLE inv_bsz (c1 int )
34243424
SERVER loopback OPTIONS (batch_size '100$%$#$#');
3425-
3426-
-- ===================================================================
3427-
-- test postgres_fdw.application_name GUC
3428-
-- ===================================================================
3429-
-- Turn debug_discard_caches off for this test to make that
3430-
-- the remote connection is alive when checking its application_name.
3431-
-- For each test, close all the existing cached connections manually and
3432-
-- establish connection with new setting of application_name.
3433-
SET debug_discard_caches = 0;
3434-
3435-
-- If appname is set as GUC but not as options of server object,
3436-
-- the GUC setting is used as application_name of remote connection.
3437-
SET postgres_fdw.application_name TO 'fdw_guc_appname';
3438-
SELECT 1 FROM postgres_fdw_disconnect_all();
3439-
SELECT 1 FROM ft6 LIMIT 1;
3440-
SELECT application_name FROM pg_stat_activity
3441-
WHERE application_name IN ('loopback2', 'fdw_guc_appname');
3442-
3443-
-- If appname is set as options of server object but not as GUC,
3444-
-- appname of server object is used.
3445-
RESET postgres_fdw.application_name;
3446-
ALTER SERVER loopback2 OPTIONS (ADD application_name 'loopback2');
3447-
SELECT 1 FROM postgres_fdw_disconnect_all();
3448-
SELECT 1 FROM ft6 LIMIT 1;
3449-
SELECT application_name FROM pg_stat_activity
3450-
WHERE application_name IN ('loopback2', 'fdw_guc_appname');
3451-
3452-
-- If appname is set both as GUC and as options of server object,
3453-
-- the GUC setting overrides appname of server object and is used.
3454-
SET postgres_fdw.application_name TO 'fdw_guc_appname';
3455-
SELECT 1 FROM postgres_fdw_disconnect_all();
3456-
SELECT 1 FROM ft6 LIMIT 1;
3457-
SELECT application_name FROM pg_stat_activity
3458-
WHERE application_name IN ('loopback2', 'fdw_guc_appname');
3459-
3460-
--Clean up
3461-
ALTER SERVER loopback2 OPTIONS (DROP application_name);
3462-
RESET postgres_fdw.application_name;
3463-
RESET debug_discard_caches;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy