Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 88f48b5

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 063ff92 commit 88f48b5

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

contrib/postgres_fdw/expected/postgres_fdw.out

+3-2
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,8 @@ ALTER FOREIGN TABLE ft2 ALTER COLUMN c1 OPTIONS (column_name 'C 1');
192192
(6 rows)
193193

194194
-- Test that alteration of server options causes reconnection
195+
-- Remote's errors might be non-English, so hide them to ensure stable results
196+
\set VERBOSITY terse
195197
SELECT c3, c4 FROM ft1 ORDER BY c3, c1 LIMIT 1; -- should work
196198
c3 | c4
197199
-------+------------------------------
@@ -201,7 +203,6 @@ SELECT c3, c4 FROM ft1 ORDER BY c3, c1 LIMIT 1; -- should work
201203
ALTER SERVER loopback OPTIONS (SET dbname 'no such database');
202204
SELECT c3, c4 FROM ft1 ORDER BY c3, c1 LIMIT 1; -- should fail
203205
ERROR: could not connect to server "loopback"
204-
DETAIL: FATAL: database "no such database" does not exist
205206
DO $d$
206207
BEGIN
207208
EXECUTE $$ALTER SERVER loopback
@@ -219,7 +220,6 @@ ALTER USER MAPPING FOR CURRENT_USER SERVER loopback
219220
OPTIONS (ADD user 'no such user');
220221
SELECT c3, c4 FROM ft1 ORDER BY c3, c1 LIMIT 1; -- should fail
221222
ERROR: could not connect to server "loopback"
222-
DETAIL: FATAL: role "no such user" does not exist
223223
ALTER USER MAPPING FOR CURRENT_USER SERVER loopback
224224
OPTIONS (DROP user);
225225
SELECT c3, c4 FROM ft1 ORDER BY c3, c1 LIMIT 1; -- should work again
@@ -228,6 +228,7 @@ SELECT c3, c4 FROM ft1 ORDER BY c3, c1 LIMIT 1; -- should work again
228228
00001 | Fri Jan 02 00:00:00 1970 PST
229229
(1 row)
230230

231+
\set VERBOSITY default
231232
-- Now we should be able to run ANALYZE.
232233
-- To exercise multiple code paths, we use local stats on ft1
233234
-- and remote-estimate mode on ft2.

contrib/postgres_fdw/sql/postgres_fdw.sql

+3
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,8 @@ ALTER FOREIGN TABLE ft2 ALTER COLUMN c1 OPTIONS (column_name 'C 1');
196196
\det+
197197

198198
-- Test that alteration of server options causes reconnection
199+
-- Remote's errors might be non-English, so hide them to ensure stable results
200+
\set VERBOSITY terse
199201
SELECT c3, c4 FROM ft1 ORDER BY c3, c1 LIMIT 1; -- should work
200202
ALTER SERVER loopback OPTIONS (SET dbname 'no such database');
201203
SELECT c3, c4 FROM ft1 ORDER BY c3, c1 LIMIT 1; -- should fail
@@ -214,6 +216,7 @@ SELECT c3, c4 FROM ft1 ORDER BY c3, c1 LIMIT 1; -- should fail
214216
ALTER USER MAPPING FOR CURRENT_USER SERVER loopback
215217
OPTIONS (DROP user);
216218
SELECT c3, c4 FROM ft1 ORDER BY c3, c1 LIMIT 1; -- should work again
219+
\set VERBOSITY default
217220

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

0 commit comments

Comments
 (0)