Fix for missing port in pg_foreign_server: default to standard 5432

This commit is contained in:
Rafa de la Torre 2019-11-14 17:57:05 +01:00
parent 7f9905cbd5
commit 064cc2a76b
2 changed files with 6 additions and 2 deletions

View File

@ -146,7 +146,7 @@ AS $$
plan = plpy.prepare("SELECT @extschema@.__CDB_FS_Foreign_Server_Port_PG($1) AS port", ['name'])
rv = plpy.execute(plan, [server_internal], 1)
port = rv[0]['port']
port = rv[0]['port'] or 5432
n_errors = 0
samples = []

View File

@ -1,4 +1,6 @@
C1|
C2|
C3|
%% It raises an error if the server does not exist
ERROR: Server "doesNotExist" does not exist
%% It returns a jsonb object
@ -18,7 +20,9 @@ ERROR: Server "doesNotExist" does not exist
%% Latency stats: stdev > 0
2.3|t
%% It raises an error if the wrong port is provided
C2|
ERROR: could not connect to server "cdb_fs_wrong-port"
%% Latency stats: can get them on default PG port 5432 when not provided
2.4|t|t
D1|
D2|
D3|