Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jKDCj-0004eM-Kj for pgsql-general@arkaria.postgresql.org; Fri, 03 Apr 2020 03:41:13 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jKDCi-0004o9-Gs for pgsql-general@arkaria.postgresql.org; Fri, 03 Apr 2020 03:41:12 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jKDCi-0004o0-1q for pgsql-general@lists.postgresql.org; Fri, 03 Apr 2020 03:41:12 +0000 Received: from mail-pg1-x532.google.com ([2607:f8b0:4864:20::532]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jKDCf-0006nz-RV for pgsql-general@lists.postgresql.org; Fri, 03 Apr 2020 03:41:11 +0000 Received: by mail-pg1-x532.google.com with SMTP id g20so2854439pgk.10 for ; Thu, 02 Apr 2020 20:41:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc:message-id:references :to; bh=9bNLWgSCHWsewVz0GE+7ZfR9YvrhE0RikqbUM1TkBgY=; b=sMntV8zpzep5BKivGn+qQyQC/Z32pvbJOIqyV8uUrol3K+HDjANGjNRy16L4w1PaiB pSXSdocJg9mj3gilIzIsi6YqLBXxZKPiy3UT8TFGt8O6z+/f6/grnCI4AMq1rt4un7ya VFhPJT12p88mXJleGn3Dv/IDr1vE79R9hMp2T+eNkpQc/5hOUFdUlYFg2Ma5Ta2o4r9d 6BAwept1vaGp1V0HNujUOPQUabC08HT85sqFdfDXZ4G4TYm5tipq3QXQ9vCrZHE0XaVZ p4Hw1babe96ox6hKJtf+La8mbjhLA04kPLKS6W3B2+Gr13fPVtAexyzJIlqKCx4/MCqA wjrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :message-id:references:to; bh=9bNLWgSCHWsewVz0GE+7ZfR9YvrhE0RikqbUM1TkBgY=; b=nA6DXbXrOiebmHZ74ozV3uJgID1WjWmP85bbqqJS3inU17reUEJobyhfE9sgZM8Ewu Err3ym8AEIBaRKLlKJ9fgg7y+3rX6iutzBSMqIZ+0+zGawurwFqz4KdusMs73LNpD2L9 Wtdi3Xzv13bm2171Os3ggISA3860VQaiiegSNQWJ3zBnU/eYJcAy7/knOp9v6jRzzw5m EjRuPyBpBM7/TjxdSY1EZQOnz42m+RJF7sutEZddXDtUUHDNF7jI04/9ORczZQG0lkQt xq6X25hJsWOwsSsIVW1St20t29pwrSG72c/gNG1nCE0CxjwizeESA0MyhozPfowFFhpv BNlg== X-Gm-Message-State: AGi0PuZazNZkYh4+IQsn92lT1WoD65wZt6BfTI1a9u6iFKEtN6CXAq6n WQqbvt2Eo75psve7cEquTcw= X-Google-Smtp-Source: APiQypJSxkcbmpdxn5JCm2Dwv0FN/pEtDwap8Oi99Q+u8OKAYyRUWsQJf/wh6AqTQVtigZvNFAGNjw== X-Received: by 2002:aa7:9433:: with SMTP id y19mr6412833pfo.233.1585885268896; Thu, 02 Apr 2020 20:41:08 -0700 (PDT) Received: from ?IPv6:2600:8801:8800:b8::b? ([2600:8801:8800:b8::b]) by smtp.gmail.com with ESMTPSA id e3sm1046481pgj.9.2020.04.02.20.41.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 02 Apr 2020 20:41:08 -0700 (PDT) Content-Type: multipart/alternative; boundary="Apple-Mail=_17B2F6A4-E989-4D10-9376-7A77754C0F4E" Mime-Version: 1.0 (Mac OS X Mail 13.0 \(3608.60.0.2.5\)) Subject: Re: Backing out of privilege grants rabbit hole From: Guyren Howe In-Reply-To: Date: Thu, 2 Apr 2020 20:41:02 -0700 Cc: "pgsql-general@lists.postgresql.org" X-Mailbutler-Message-Id: 18B44B17-B1CB-4089-8811-F8FD5560AA0A Message-Id: <8EC7DEE2-10DB-4A3B-AC1B-CEC3D4E01414@gmail.com> References: To: AC Gomez X-Mailer: Apple Mail (2.3608.60.0.2.5) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --Apple-Mail=_17B2F6A4-E989-4D10-9376-7A77754C0F4E Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii More fully: REASSIGN OWNED BY doomed_role TO successor_role; DROP OWNED BY doomed_role; -- repeat the above commands in each database of the cluster DROP ROLE doomed_role; > On Apr 2, 2020, at 20:37 , Guyren Howe wrote: >=20 > https://www.postgresql.org/docs/12/sql-drop-owned.html = >=20 >> On Apr 2, 2020, at 20:34 , AC Gomez > wrote: >>=20 >> Do I understand correctly that if a role was assigned countless = object privileges and you want to delete that role you have to sift = through a myriad of privilege grants in what amounts to a time consuming = trial and error exercise until you've got them all? >>=20 >> Or is there a single command that with just delete the role and do a = blanket grant removal at the same time? >>=20 --Apple-Mail=_17B2F6A4-E989-4D10-9376-7A77754C0F4E Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8 More = fully:

REASSIGN OWNED BY doomed_role =
TO successor_role;
DROP OWNED BY doomed_role;
-- repeat the above commands in each database of the cluster
DROP ROLE doomed_role;

On Apr 2, 2020, at 20:37 , Guyren Howe <guyren@gmail.com> = wrote:

https://www.postgresql.org/docs/12/sql-drop-owned.html

On Apr 2, 2020, at 20:34 , AC Gomez <antklc@gmail.com> = wrote:

Do I understand correctly that if a role was assigned countless = object privileges and you want to delete that role you have to sift = through a myriad of privilege grants in what amounts to a time consuming = trial and error exercise until you've got them all?

Or is there = a single command that with just delete the role and do a blanket grant = removal at the same time?


3D""= --Apple-Mail=_17B2F6A4-E989-4D10-9376-7A77754C0F4E--