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

Commit 0d503dd

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 0fe2160 commit 0d503dd

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
@@ -184,6 +184,8 @@ ALTER FOREIGN TABLE ft2 ALTER COLUMN c1 OPTIONS (column_name 'C 1');
184184
(5 rows)
185185

186186
-- Test that alteration of server options causes reconnection
187+
-- Remote's errors might be non-English, so hide them to ensure stable results
188+
\set VERBOSITY terse
187189
SELECT c3, c4 FROM ft1 ORDER BY c3, c1 LIMIT 1; -- should work
188190
c3 | c4
189191
-------+------------------------------
@@ -193,7 +195,6 @@ SELECT c3, c4 FROM ft1 ORDER BY c3, c1 LIMIT 1; -- should work
193195
ALTER SERVER loopback OPTIONS (SET dbname 'no such database');
194196
SELECT c3, c4 FROM ft1 ORDER BY c3, c1 LIMIT 1; -- should fail
195197
ERROR: could not connect to server "loopback"
196-
DETAIL: FATAL: database "no such database" does not exist
197198
DO $d$
198199
BEGIN
199200
EXECUTE $$ALTER SERVER loopback
@@ -211,7 +212,6 @@ ALTER USER MAPPING FOR CURRENT_USER SERVER loopback
211212
OPTIONS (ADD user 'no such user');
212213
SELECT c3, c4 FROM ft1 ORDER BY c3, c1 LIMIT 1; -- should fail
213214
ERROR: could not connect to server "loopback"
214-
DETAIL: FATAL: role "no such user" does not exist
215215
ALTER USER MAPPING FOR CURRENT_USER SERVER loopback
216216
OPTIONS (DROP user);
217217
SELECT c3, c4 FROM ft1 ORDER BY c3, c1 LIMIT 1; -- should work again
@@ -220,6 +220,7 @@ SELECT c3, c4 FROM ft1 ORDER BY c3, c1 LIMIT 1; -- should work again
220220
00001 | Fri Jan 02 00:00:00 1970 PST
221221
(1 row)
222222

223+
\set VERBOSITY default
223224
-- Now we should be able to run ANALYZE.
224225
-- To exercise multiple code paths, we use local stats on ft1
225226
-- and remote-estimate mode on ft2.

contrib/postgres_fdw/sql/postgres_fdw.sql

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

190190
-- Test that alteration of server options causes reconnection
191+
-- Remote's errors might be non-English, so hide them to ensure stable results
192+
\set VERBOSITY terse
191193
SELECT c3, c4 FROM ft1 ORDER BY c3, c1 LIMIT 1; -- should work
192194
ALTER SERVER loopback OPTIONS (SET dbname 'no such database');
193195
SELECT c3, c4 FROM ft1 ORDER BY c3, c1 LIMIT 1; -- should fail
@@ -206,6 +208,7 @@ SELECT c3, c4 FROM ft1 ORDER BY c3, c1 LIMIT 1; -- should fail
206208
ALTER USER MAPPING FOR CURRENT_USER SERVER loopback
207209
OPTIONS (DROP user);
208210
SELECT c3, c4 FROM ft1 ORDER BY c3, c1 LIMIT 1; -- should work again
211+
\set VERBOSITY default
209212

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

0 commit comments

Comments
 (0)