Stub function to add server_version to diagnostics
This commit is contained in:
parent
35b2b7e589
commit
40a2ba9569
@ -2,11 +2,24 @@
|
||||
-- Private functions
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
CREATE OR REPLACE FUNCTION @extschema@.__CDB_FS_Server_Version_PG(server_internal name)
|
||||
RETURNS text
|
||||
AS $$
|
||||
BEGIN
|
||||
-- TODO Implement
|
||||
RETURN '14.0';
|
||||
END
|
||||
$$
|
||||
LANGUAGE PLPGSQL VOLATILE PARALLEL UNSAFE;
|
||||
|
||||
|
||||
CREATE OR REPLACE FUNCTION @extschema@.__CDB_FS_Server_Diagnostics_PG(server_internal name)
|
||||
RETURNS jsonb
|
||||
AS $$
|
||||
DECLARE
|
||||
remote_server_version text := @extschema@.__CDB_FS_Server_Version_PG(server_internal);
|
||||
BEGIN
|
||||
RETURN '{}'::jsonb;
|
||||
RETURN jsonb_build_object('server_version', remote_server_version);
|
||||
END
|
||||
$$
|
||||
LANGUAGE PLPGSQL VOLATILE PARALLEL UNSAFE;
|
||||
|
@ -34,6 +34,9 @@ SELECT '1.1', cartodb.CDB_Federated_Server_Diagnostics(server => 'doesNotExist')
|
||||
\echo '%% It returns a jsonb object'
|
||||
SELECT '1.2', pg_typeof(cartodb.CDB_Federated_Server_Diagnostics(server => 'loopback'));
|
||||
|
||||
\echo '%% It returns the server version'
|
||||
SELECT '1.3', cartodb.CDB_Federated_Server_Diagnostics(server => 'loopback') @> '{"server_version": "14.0"}'::jsonb;
|
||||
|
||||
|
||||
-- ===================================================================
|
||||
-- Cleanup
|
||||
|
@ -3,4 +3,6 @@ C1|
|
||||
ERROR: Server "doesNotExist" does not exist
|
||||
%% It returns a jsonb object
|
||||
1.2|jsonb
|
||||
%% It returns the server version
|
||||
1.3|t
|
||||
D1|
|
||||
|
Loading…
Reference in New Issue
Block a user