2019-02-20 21:45:57 +08:00
|
|
|
-- Returns the cartodb username of the current PostgreSQL session
|
2019-05-31 21:29:28 +08:00
|
|
|
CREATE OR REPLACE FUNCTION @extschema@.CDB_Username()
|
2019-02-20 17:38:00 +08:00
|
|
|
RETURNS text
|
|
|
|
AS $$
|
2019-10-03 22:54:55 +08:00
|
|
|
SELECT @extschema@.CDB_Conf_GetConf(concat('api_keys_', session_user))->>'username';
|
|
|
|
$$ LANGUAGE SQL
|
|
|
|
STABLE
|
|
|
|
PARALLEL SAFE
|
|
|
|
SECURITY DEFINER
|
2019-10-03 23:29:35 +08:00
|
|
|
SET search_path = pg_temp;
|