CDB-3030 adapted signature to proper one, added NEWS entry

This commit is contained in:
Kartones 2014-06-02 18:00:39 +02:00
parent fc346e4772
commit 225a236dd8
2 changed files with 13 additions and 4 deletions

9
NEWS
View File

@ -1,3 +1,12 @@
0.x.0
-----
New features:
- Added CDB_UserDomain
0.2.0dev - 2014-MM-DD
------------------

View File

@ -1,15 +1,15 @@
-- Function that setups user's domain, port and http/https inside his own DB.
-- Function that setups user's host, 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)
CREATE OR REPLACE FUNCTION CDB_SetUserDomain(host 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) '
|| ' RETURNS TABLE (host text, port int8, secure boolean) '
|| ' AS $X$ '
|| ' SELECT ''' || domain || '''::text, ' || port || '::int8, ' || secure || '::boolean '
|| ' SELECT ''' || host || '''::text, ' || port || '::int8, ' || secure || '::boolean '
|| ' $X$ LANGUAGE sql IMMUTABLE';
EXECUTE sql;
RETURN;