Skip to content

Commit 6d9de66

Browse files
committed
Stabilize postgres_fdw regression tests.
The new test cases added in commit 8bf58c0 turn out to have output that can vary depending on the lc_messages setting prevailing on the test server. Hide the remote end's error messages to ensure stable output. This isn't a terribly desirable solution; we'd rather know that the connection failed for the expected reason and not some other one. But there seems little choice for the moment. Per buildfarm. Discussion: https://postgr.es/m/18419.1500658570@sss.pgh.pa.us
1 parent 6971141 commit 6d9de66

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

contrib/postgres_fdw/expected/postgres_fdw.out

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,8 @@ ALTER FOREIGN TABLE ft2 ALTER COLUMN c1 OPTIONS (column_name 'C 1');
121121
(2 rows)
122122

123123
-- Test that alteration of server options causes reconnection
124+
-- Remote's errors might be non-English, so hide them to ensure stable results
125+
\set VERBOSITY terse
124126
SELECT c3, c4 FROM ft1 ORDER BY c3, c1 LIMIT 1; -- should work
125127
c3 | c4
126128
-------+------------------------------
@@ -130,7 +132,6 @@ SELECT c3, c4 FROM ft1 ORDER BY c3, c1 LIMIT 1; -- should work
130132
ALTER SERVER loopback OPTIONS (SET dbname 'no such database');
131133
SELECT c3, c4 FROM ft1 ORDER BY c3, c1 LIMIT 1; -- should fail
132134
ERROR: could not connect to server "loopback"
133-
DETAIL: FATAL: database "no such database" does not exist
134135
DO $d$
135136
BEGIN
136137
EXECUTE $$ALTER SERVER loopback
@@ -148,7 +149,6 @@ ALTER USER MAPPING FOR CURRENT_USER SERVER loopback
148149
OPTIONS (ADD user 'no such user');
149150
SELECT c3, c4 FROM ft1 ORDER BY c3, c1 LIMIT 1; -- should fail
150151
ERROR: could not connect to server "loopback"
151-
DETAIL: FATAL: role "no such user" does not exist
152152
ALTER USER MAPPING FOR CURRENT_USER SERVER loopback
153153
OPTIONS (DROP user);
154154
SELECT c3, c4 FROM ft1 ORDER BY c3, c1 LIMIT 1; -- should work again
@@ -157,6 +157,7 @@ SELECT c3, c4 FROM ft1 ORDER BY c3, c1 LIMIT 1; -- should work again
157157
00001 | Fri Jan 02 00:00:00 1970 PST
158158
(1 row)
159159

160+
\set VERBOSITY default
160161
-- Now we should be able to run ANALYZE.
161162
-- To exercise multiple code paths, we use local stats on ft1
162163
-- and remote-estimate mode on ft2.

contrib/postgres_fdw/sql/postgres_fdw.sql

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,8 @@ ALTER FOREIGN TABLE ft2 ALTER COLUMN c1 OPTIONS (column_name 'C 1');
124124
\det+
125125

126126
-- Test that alteration of server options causes reconnection
127+
-- Remote's errors might be non-English, so hide them to ensure stable results
128+
\set VERBOSITY terse
127129
SELECT c3, c4 FROM ft1 ORDER BY c3, c1 LIMIT 1; -- should work
128130
ALTER SERVER loopback OPTIONS (SET dbname 'no such database');
129131
SELECT c3, c4 FROM ft1 ORDER BY c3, c1 LIMIT 1; -- should fail
@@ -142,6 +144,7 @@ SELECT c3, c4 FROM ft1 ORDER BY c3, c1 LIMIT 1; -- should fail
142144
ALTER USER MAPPING FOR CURRENT_USER SERVER loopback
143145
OPTIONS (DROP user);
144146
SELECT c3, c4 FROM ft1 ORDER BY c3, c1 LIMIT 1; -- should work again
147+
\set VERBOSITY default
145148

146149
-- Now we should be able to run ANALYZE.
147150
-- To exercise multiple code paths, we use local stats on ft1

0 commit comments

Comments
 (0)