diff --git a/scripts-available/CDB_Groups.sql b/scripts-available/CDB_Groups.sql index 00cc8c7..d87c2f3 100644 --- a/scripts-available/CDB_Groups.sql +++ b/scripts-available/CDB_Groups.sql @@ -118,7 +118,7 @@ FUNCTION cartodb._CDB_User_RoleFromUsername(username text) DECLARE user_role TEXT; BEGIN - EXECUTE 'SELECT SCHEMA_OWNER FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME = ''' || username || ''' LIMIT 1' INTO user_role; + EXECUTE 'SELECT SCHEMA_OWNER FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME = $1 LIMIT 1' INTO user_role USING username; RETURN user_role; END $$ LANGUAGE PLPGSQL;