Prepend an underscore (_) to functions meant to be run by superuser

_CDB_SetUp_User_PG_FDW_Server and _CDB_Drop_User_PG_FDW_Server are
meant to be executed by a superuser. Therefore they shouldn't be
considered part of the public API and hence the _CDB_Private_Function
naming convention.
This commit is contained in:
Rafa de la Torre
2019-07-16 14:32:32 +02:00
parent a32dea0282
commit 0f33ee8b22
2 changed files with 5 additions and 5 deletions

View File

@@ -170,7 +170,7 @@ LANGUAGE plpgsql VOLATILE PARALLEL UNSAFE;
-- * Specific roles: GRANT amazon TO role_name;
-- * Members of the organization: SELECT cartodb.CDB_Organization_Grant_Role('amazon');
-- * The publicuser: GRANT amazon TO publicuser;
CREATE OR REPLACE FUNCTION @extschema@.CDB_SetUp_User_PG_FDW_Server(fdw_name NAME, config json)
CREATE OR REPLACE FUNCTION @extschema@._CDB_SetUp_User_PG_FDW_Server(fdw_name NAME, config json)
RETURNS void AS $$
DECLARE
row record;
@@ -248,7 +248,7 @@ $$ LANGUAGE plpgsql VOLATILE PARALLEL UNSAFE;
-- SELECT cartodb.CDB_Drop_User_PG_FDW_Server('amazon')
--
-- Note: if there's any dependent object (i.e. foreign table) this call will fail
CREATE OR REPLACE FUNCTION @extschema@.CDB_Drop_User_PG_FDW_Server(fdw_name NAME)
CREATE OR REPLACE FUNCTION @extschema@._CDB_Drop_User_PG_FDW_Server(fdw_name NAME)
RETURNS void AS $$
BEGIN
EXECUTE FORMAT ('DROP SCHEMA %I', fdw_name);