Fix for missing port in pg_foreign_server: default to standard 5432
This commit is contained in:
@@ -146,7 +146,7 @@ AS $$
|
|||||||
|
|
||||||
plan = plpy.prepare("SELECT @extschema@.__CDB_FS_Foreign_Server_Port_PG($1) AS port", ['name'])
|
plan = plpy.prepare("SELECT @extschema@.__CDB_FS_Foreign_Server_Port_PG($1) AS port", ['name'])
|
||||||
rv = plpy.execute(plan, [server_internal], 1)
|
rv = plpy.execute(plan, [server_internal], 1)
|
||||||
port = rv[0]['port']
|
port = rv[0]['port'] or 5432
|
||||||
|
|
||||||
n_errors = 0
|
n_errors = 0
|
||||||
samples = []
|
samples = []
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
C1|
|
C1|
|
||||||
|
C2|
|
||||||
|
C3|
|
||||||
%% It raises an error if the server does not exist
|
%% It raises an error if the server does not exist
|
||||||
ERROR: Server "doesNotExist" does not exist
|
ERROR: Server "doesNotExist" does not exist
|
||||||
%% It returns a jsonb object
|
%% It returns a jsonb object
|
||||||
@@ -18,7 +20,9 @@ ERROR: Server "doesNotExist" does not exist
|
|||||||
%% Latency stats: stdev > 0
|
%% Latency stats: stdev > 0
|
||||||
2.3|t
|
2.3|t
|
||||||
%% It raises an error if the wrong port is provided
|
%% It raises an error if the wrong port is provided
|
||||||
C2|
|
|
||||||
ERROR: could not connect to server "cdb_fs_wrong-port"
|
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|
|
D1|
|
||||||
D2|
|
D2|
|
||||||
|
D3|
|
||||||
|
|||||||
Reference in New Issue
Block a user