Skeleton for CDB_SetUp_PG_Federated_Server

This commit is contained in:
Rafa de la Torre 2019-10-08 10:43:16 +02:00
parent b68ce72889
commit 8e005e556e
3 changed files with 31 additions and 0 deletions

View File

@ -0,0 +1,27 @@
----------------------------------------------------------------------
-- Federated Tables management functions
----------------------------------------------------------------------
--
-- Set up a federated server for later connection of tables/views
-- E.g:
-- SELECT cartodb.CDB_SetUp_PG_Federated_Server('amazon', '{
-- "server": {
-- "dbname": "testdb",
-- "host": "myhostname.us-east-2.rds.amazonaws.com",
-- "port": "5432"
-- },
-- "credentials": {
-- "username": "read_only_user",
-- "password": "secret"
-- }
-- }');
CREATE OR REPLACE FUNCTION @extschema@.CDB_SetUp_PG_Federated_Server(server_alias text, config json)
RETURNS void
AS $$
BEGIN
-- TODO
END
$$
LANGUAGE PLPGSQL VOLATILE PARALLEL UNSAFE;

View File

@ -0,0 +1 @@
../scripts-available/CDB_PG_Federated_Tables.sql

View File

@ -663,6 +663,9 @@ EOF
DATABASE=fdw_target tear_down_database
}
function test_federated_tables() {
}
function test_cdb_catalog_basic_node() {
DEF="'{\"type\":\"buffer\",\"source\":\"b2db66bc7ac02e135fd20bbfef0fdd81b2d15fad\",\"radio\":10000}'"
sql postgres "INSERT INTO cartodb.cdb_analysis_catalog (node_id, analysis_def) VALUES ('1bbc4c41ea7c9d3a7dc1509727f698b7', ${DEF}::json)"