diff --git a/scripts-available/CDB_PG_Federated_Tables.sql b/scripts-available/CDB_PG_Federated_Tables.sql index 348ebb2..6b717bb 100644 --- a/scripts-available/CDB_PG_Federated_Tables.sql +++ b/scripts-available/CDB_PG_Federated_Tables.sql @@ -4,7 +4,7 @@ -- Take a config jsonb and transform it to an input suitable for -- _CDB_SetUp_User_PG_FDW_Server -CREATE OR REPLACE FUNCTION @extschema@.__cdb_credentials_to_user_mapping(input_config jsonb) +CREATE OR REPLACE FUNCTION @extschema@.__ft_credentials_to_user_mapping(input_config jsonb) RETURNS jsonb AS $$ DECLARE @@ -24,7 +24,7 @@ LANGUAGE PLPGSQL IMMUTABLE PARALLEL SAFE; -- Take a config jsonb as input and return it augmented with default -- options -CREATE OR REPLACE FUNCTION @extschema@.__cdb_add_default_options(input_config jsonb) +CREATE OR REPLACE FUNCTION @extschema@.__ft_add_default_options(input_config jsonb) RETURNS jsonb AS $$ DECLARE @@ -63,8 +63,8 @@ AS $$ DECLARE final_config jsonb; BEGIN - final_config := @extschema@.__cdb_credentials_to_user_mapping( - @extschema@.__cdb_add_default_options(server_config) + final_config := @extschema@.__ft_credentials_to_user_mapping( + @extschema@.__ft_add_default_options(server_config) ); PERFORM cartodb._CDB_SetUp_User_PG_FDW_Server(server_alias, final_config::json); END diff --git a/test/extension/test.sh b/test/extension/test.sh index 14c5110..37a8816 100755 --- a/test/extension/test.sh +++ b/test/extension/test.sh @@ -690,7 +690,7 @@ function test_federated_tables() { } EOF - # Unit-test __cdb_credentials_to_user_mapping + # Unit-test __ft_credentials_to_user_mapping read -d '' expected_user_mapping <<- EOF { "server": { @@ -704,10 +704,10 @@ EOF } } EOF - sql postgres "SELECT cartodb.__cdb_credentials_to_user_mapping('$federated_server_config') = '$expected_user_mapping'" \ + sql postgres "SELECT cartodb.__ft_credentials_to_user_mapping('$federated_server_config') = '$expected_user_mapping'" \ should 't' - # Unit-test __cdb_add_default_options + # Unit-test __ft_add_default_options read -d '' expected_default_options <<- EOF { "server": { @@ -725,7 +725,7 @@ EOF } } EOF - sql postgres "SELECT cartodb.__cdb_add_default_options('$federated_server_config') = '$expected_default_options'" \ + sql postgres "SELECT cartodb.__ft_add_default_options('$federated_server_config') = '$expected_default_options'" \ should 't' # There must be a function with the expected interface