Return postgis version in diagnostics info (WIP)
This commit is contained in:
parent
8730292097
commit
d4bc69cd3c
@ -41,6 +41,17 @@ $$
|
||||
LANGUAGE PLPGSQL VOLATILE PARALLEL UNSAFE;
|
||||
|
||||
|
||||
CREATE OR REPLACE FUNCTION @extschema@.__CDB_FS_Foreign_PostGIS_Version_PG(server_internal name)
|
||||
RETURNS text
|
||||
AS $$
|
||||
BEGIN
|
||||
-- TODO implement
|
||||
RETURN '4.0';
|
||||
END
|
||||
$$
|
||||
LANGUAGE PLPGSQL VOLATILE PARALLEL UNSAFE;
|
||||
|
||||
|
||||
--
|
||||
-- Collect and return diagnostics info from a remote PG into a jsonb
|
||||
--
|
||||
@ -48,9 +59,13 @@ CREATE OR REPLACE FUNCTION @extschema@.__CDB_FS_Server_Diagnostics_PG(server_int
|
||||
RETURNS jsonb
|
||||
AS $$
|
||||
DECLARE
|
||||
remote_server_version text := @extschema@.__CDB_FS_Foreign_Server_Version_PG(server_internal);
|
||||
remote_server_version text := @extschema@.__CDB_FS_Foreign_Server_Version_PG(server_internal);
|
||||
remote_postgis_version text := @extschema@.__CDB_FS_Foreign_PostGIS_Version_PG(server_internal);
|
||||
BEGIN
|
||||
RETURN jsonb_build_object('server_version', remote_server_version);
|
||||
RETURN jsonb_build_object(
|
||||
'server_version', remote_server_version,
|
||||
'postgis_version', remote_postgis_version
|
||||
);
|
||||
END
|
||||
$$
|
||||
LANGUAGE PLPGSQL VOLATILE PARALLEL UNSAFE;
|
||||
|
@ -38,6 +38,10 @@ SELECT '1.2', pg_typeof(cartodb.CDB_Federated_Server_Diagnostics(server => 'loop
|
||||
SELECT '1.3', cartodb.CDB_Federated_Server_Diagnostics(server => 'loopback') @> format('{"server_version": "%s"}', setting)::jsonb
|
||||
FROM pg_settings WHERE name = 'server_version';
|
||||
|
||||
\echo '%% It returns the postgis version'
|
||||
SELECT '1.4', cartodb.CDB_Federated_Server_Diagnostics(server => 'loopback') @> format('{"postgis_version": "%s"}', extversion)::jsonb
|
||||
FROM pg_extension WHERE extname = 'postgis';
|
||||
|
||||
|
||||
-- ===================================================================
|
||||
-- Cleanup
|
||||
|
@ -5,4 +5,6 @@ ERROR: Server "doesNotExist" does not exist
|
||||
1.2|jsonb
|
||||
%% It returns the server version
|
||||
1.3|t
|
||||
%% It returns the postgis version
|
||||
1.4|t
|
||||
D1|
|
||||
|
Loading…
Reference in New Issue
Block a user