From 8ecd2cd5e20be44441325393604a3358e123a5ac Mon Sep 17 00:00:00 2001 From: Mario de Frutos Dieguez Date: Thu, 4 Jul 2019 11:26:26 +0200 Subject: [PATCH] Reuser creator_role Co-Authored-By: Alberto Romeu --- scripts-available/CDB_OAuth.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts-available/CDB_OAuth.sql b/scripts-available/CDB_OAuth.sql index 16f75f2..8a81ae5 100644 --- a/scripts-available/CDB_OAuth.sql +++ b/scripts-available/CDB_OAuth.sql @@ -17,7 +17,7 @@ BEGIN obj.schema_name, obj.object_identity; SELECT rolname FROM pg_class JOIN pg_roles ON relowner = pg_roles.oid WHERE pg_class.oid = obj.objid INTO creator_role; - SELECT value->>'ownership_role_name' from cdb_conf where key = (SELECT 'api_keys_' || rolname FROM pg_class JOIN pg_roles ON relowner = pg_roles.oid WHERE pg_class.oid = obj.objid) INTO owner_role; + SELECT value->>'ownership_role_name' from cdb_conf where key = 'api_keys_' || creator_role INTO owner_role; IF owner_role IS NULL THEN CONTINUE; ELSE