CDB-3030 Added CDB_UserDomain script
This commit is contained in:
parent
ce20009fb2
commit
fc346e4772
18
scripts-available/CDB_UserDomain.sql
Normal file
18
scripts-available/CDB_UserDomain.sql
Normal file
@ -0,0 +1,18 @@
|
||||
-- Function that setups user's domain, port and http/https inside his own DB.
|
||||
-- Used for HTTP table sync functions.
|
||||
CREATE OR REPLACE FUNCTION CDB_SetUserDomain(domain text, port int8, secure boolean)
|
||||
RETURNS VOID AS
|
||||
$$
|
||||
DECLARE
|
||||
sql TEXT;
|
||||
BEGIN
|
||||
sql := 'CREATE OR REPLACE FUNCTION public._CDB_UserDomain() '
|
||||
|| ' RETURNS TABLE (domain text, port int8, secure boolean) '
|
||||
|| ' AS $X$ '
|
||||
|| ' SELECT ''' || domain || '''::text, ' || port || '::int8, ' || secure || '::boolean '
|
||||
|| ' $X$ LANGUAGE sql IMMUTABLE';
|
||||
EXECUTE sql;
|
||||
RETURN;
|
||||
END
|
||||
$$
|
||||
LANGUAGE 'plpgsql' VOLATILE STRICT;
|
1
scripts-enabled/210-CDB_UserDomain.sql
Symbolic link
1
scripts-enabled/210-CDB_UserDomain.sql
Symbolic link
@ -0,0 +1 @@
|
||||
../scripts-available/CDB_UserDomain.sql
|
Loading…
Reference in New Issue
Block a user