Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wGQuH-006DLY-0Q for pgsql-hackers@arkaria.postgresql.org; Sat, 25 Apr 2026 00:30:01 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wGQuG-007y7i-0M for pgsql-hackers@arkaria.postgresql.org; Sat, 25 Apr 2026 00:30:00 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wGQuF-007y7a-2e for pgsql-hackers@lists.postgresql.org; Sat, 25 Apr 2026 00:29:59 +0000 Received: from mail-ej1-x632.google.com ([2a00:1450:4864:20::632]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wGQuD-00000002eb0-19fP for pgsql-hackers@postgresql.org; Sat, 25 Apr 2026 00:29:58 +0000 Received: by mail-ej1-x632.google.com with SMTP id a640c23a62f3a-b8f9568e074so1404642466b.0 for ; Fri, 24 Apr 2026 17:29:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1777076996; cv=none; d=google.com; s=arc-20240605; b=itzPzXWQvw2ICscySDjZtlznMDZCPYKtym7PW96CJDaioP9fGP9Qlha5gXGgEjqh55 XmZgNi216BUaUlF5bFLJ2qbI+mTrmHQXg8XJujW8XI6/HlsCkHD8eGzh7P+VzQtR9CjA 289bftamM4CO+9xgb4mT+frqT6qg3mwME8NVPGZiDYnvycq77b8qCrAvDvzA/O27YSGA FutQrIffa6DQsk+Du0ZCOTF5Kgnt0FT6I8SB0YnyvNrSwm4O0EzIPwJA1XYeraEBH13k 6vFQRDzyt9RsF4Nu+qM0v+hX15doOqrsx/lgJjfXqBkif/ymtYWHk1yym4EV4MzZDSWm iUsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=qaKfpbPQNvNQNPWKJNo+aTc4n9fyqcm5pW09K1JzQ0g=; fh=KbdDJSQqS8I4jiTNQ86YmvtzCnc3Wvfb5ZEcOtKEGZE=; b=USZs5SmX8Dw4nvuHBDVxyqbTSjNIiaoHNxD8ebL37G4QrE1V0Kc1smEWYK9oFfxih8 9Zhxs/x1Jec5bU+g3fHt6HIeEr5OD1Lgh9Rz0P5UTUrqWh9pE9L6+JQcEp/3PkEPlyF3 +mNScZnhbLydcTwQS41hd2B7zoqni1ZGDH0MQETtFjDNvejChoQ/c/g73m3wcSEa2fBY xAJEV0mv1abbROBLcscYKVKoaQD8jcITWRWS3Ex3Ij7kSCyEUklAeW4JR5V88MZ8WJK+ WGDgBunI8aAoCuwhftKBWU4lcqvne/Y07V5jCI21vfFBGLqP29IGld45sGnw7e1NzaRs tlDA==; darn=postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1777076996; x=1777681796; darn=postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=qaKfpbPQNvNQNPWKJNo+aTc4n9fyqcm5pW09K1JzQ0g=; b=ZC1MaaUe0qFr562Hnsem9nOI7kTQJWxqKHSjfb5dTrMBnJUSzng1w4lun1aHqZff0O 3VtDnkvvzBV6NnnGRm3cnCxN7dpXAp9yechGszx1PcOkJcKr8xJYguj8eahj/EJq2k+C vBr09T+mDiQ7wHS2NsjWbkdWYHYSmYXJvI78kvjob4lAXFOxEMOKoyelq/D2BYnmZhb4 iJENSlSzEDt0Q5bq0EFZ/jjHvtQaDTeu7dUCZAGEC69iM1cd0ixqbZ1U0oH9bu2KT7bm 57f7BdltS/K8ddnlcdxdd0OrS5sHYTOjgWnUTTooGXCYMjH991tZzELDcEFOXt+6lWYq qqxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777076996; x=1777681796; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=qaKfpbPQNvNQNPWKJNo+aTc4n9fyqcm5pW09K1JzQ0g=; b=WKCN3qURzJCAtNc6OJ4Js55u04vGRdrlhw/LDDYrbRE8Zl0mrf3luRYswdIk0I0OYk yM1hbVdEJu/EsS0GAd9vMreoraevpKzrAruZHfwnQX89T5G6ufOD5ZrKmCAwxqhgGNKu E4P1YubIKI+E+WOwEopR1ShHXv6pbybaSq9gfQ6Hk+o+dc1hqFAwBk2XqBsf3YGbMlfg o0f3QiZ5dHjIGi8CKws0KsPSU8zCf1K+adhQM1xhGKpvoBPyzgiEEcQFbftd4CmcjoE4 0oEuSNn3if8Xf+8haVPz20vl1OUDcivqUSHFwjfND43l2q+AqBW5epguIRfTPU6kmGaY ywTg== X-Gm-Message-State: AOJu0Yy49p0k5F0lrVYXuDXXGN9V5+TlTd/tVnjjGCEG67hP3rXB0out tb2DPpfo8TdZdrMBbfoOdATkszDqAa+jv7Y4Jf8DNe1zw4EmFmF4V9edTYdYLTvOv30GT9jVk8y 7uuPzmi+WlQWJag9n+7F6I3AvkptRbsfSsPfl X-Gm-Gg: AeBDieuiLNQ0xhRJRTS8cTg5MIARIYE21n3VGg8wSRev1f3hAimvv5j+etOJ8iy9Gvc qtG2jafFgzlKk++pn7NXmcfJS9BTUibrF4eumHHJCFOF+4PR/CpM+MNPeNHMY00rulWinnw6KLY FHNK4jFl/aBr2fBYyZCILvhr+qpbrgTjDcgI3hkSW7LnmbJm7ya+4MdxzPrr76W1C3gm+VBGOyD Iw1JFwbGKuiCPYOGjjTkVxZyXWy1TKM0B8q22im4QXZPt1GA0kjI25CqXsfG9IQNS11OQ9gsXua gfYh+siWqIptyK0Gbo2WAVB7/JvjUC4a1F/jXNaYnLirAf5aPQ== X-Received: by 2002:a17:907:cd09:b0:b9e:f58:c581 with SMTP id a640c23a62f3a-ba41b3dff09mr2023412866b.45.1777076995887; Fri, 24 Apr 2026 17:29:55 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Robert Haas Date: Fri, 24 Apr 2026 20:29:43 -0400 X-Gm-Features: AQROBzBvhiQjZU8WaF4w9knCqku2t0ME-QviRdX6EKg_e33SZmogDlPydODAi68 Message-ID: Subject: Re: Proposal: DROP ROLE ... REASSIGN OWNED TO ... To: Zach Manifold Cc: pgsql-hackers@postgresql.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Thu, Apr 23, 2026 at 2:59=E2=80=AFAM Zach Manifold wrote: > My one concern is the possible failure mode - is it possible for > the reassignment to work but the role to fail to drop? Is this > preventable? I'm not sure how to "cleanly" approach this type > of safety where I can assure that both of these operations > must succeed rather than reassigning ownership and failing > to drop a role. There's no problem of this type -- the whole statement would execute as a single transaction, and any failure would role the whole thing back. But I'm a little bit skeptical of the underlying proposal for related reasons. This doesn't really let you do anything that you can't easily do already: rhaas=3D# create role joe; CREATE ROLE rhaas=3D# begin; BEGIN rhaas=3D*# reassign owned by joe to fred; REASSIGN OWNED rhaas=3D*# drop role joe; DROP ROLE rhaas=3D*# commit; COMMIT This would fail if the user to be dropped owned objects in another database, but your hypothetical version of DROP ROLE would have that issue, too. Even if you couldn't wrap both commands in a single transaction -- we have some DDL commands that are like that -- running them one after another wouldn't lose much. So I'm just not sure I really see the point. If we add a bunch of stuff like this, it will take work to maintain, but most users won't be able to remember all the variations that exist at the moment when they might benefit from them. We might also end up with a patchwork where some things are supported and seemingly related things are not supported, just because of the idiosyncrasies of what got implemented and what didn't. I'm not saying nobody would ever benefit from something like this -- probably some people would -- but I don't know that there would be all that many of them or that the benefit would be all that much. --=20 Robert Haas EDB: http://www.enterprisedb.com