CDB-3030 Added CDB_UserDomain script

This commit is contained in:
Kartones 2014-06-02 17:21:52 +02:00
parent ce20009fb2
commit fc346e4772
2 changed files with 19 additions and 0 deletions

View 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;

View File

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