Extract the username and the orgname as strings

This commit is contained in:
Mario de Frutos
2016-01-22 19:18:34 +01:00
parent 1a8109ecdf
commit 62ade7f1a0
10 changed files with 97 additions and 31 deletions

View File

@@ -25,9 +25,9 @@ BEGIN
FROM pg_namespace s
LEFT JOIN pg_roles r ON s.nspowner = r.oid
WHERE r.rolname = session_user INTO username;
SELECT cartodb.cdb_conf_getconf('user_config')->'entity_name' INTO organization_name;
SELECT cartodb.cdb_conf_getconf('user_config')->>'entity_name' INTO organization_name;
ELSE
SELECT cartodb.cdb_conf_getconf('user_config')->'entity_name' INTO username;
SELECT cartodb.cdb_conf_getconf('user_config')->>'entity_name' INTO username;
organization_name = NULL;
END IF;
result.username = username;