2019-02-20 21:45:57 +08:00
|
|
|
-- Returns the cartodb username of the current PostgreSQL session
|
2019-03-13 17:29:50 +08:00
|
|
|
CREATE OR REPLACE FUNCTION cartodb.CDB_Username()
|
2019-02-20 17:38:00 +08:00
|
|
|
RETURNS text
|
|
|
|
AS $$
|
2019-03-13 17:29:50 +08:00
|
|
|
SELECT cartodb.CDB_Conf_GetConf(CONCAT('api_keys_', session_user))->>'username';
|
2019-02-20 21:45:57 +08:00
|
|
|
$$ LANGUAGE SQL STABLE PARALLEL SAFE SECURITY DEFINER;
|