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 1x4dXq-007I7k-2y for pgsql-bugs@arkaria.postgresql.org; Thu, 10 Sep 2026 12:06:23 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1x4dXp-005IhU-2t for pgsql-bugs@arkaria.postgresql.org; Thu, 10 Sep 2026 12:06:21 +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 1x4Ed7-00DQUH-2x for pgsql-bugs@lists.postgresql.org; Wed, 09 Sep 2026 09:30:10 +0000 Received: from mahout.postgresql.org ([2001:4800:3e1:1::227]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1x4Ed4-00000004kMi-49VM for pgsql-bugs@lists.postgresql.org; Wed, 09 Sep 2026 09:30:08 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=postgresql.org; s=20171124; h=Message-ID:Date:Reply-To:Cc:From:To:Subject: Content-Transfer-Encoding:MIME-Version:Content-Type:Sender:Content-ID: Content-Description:In-Reply-To:References; bh=Gt34L6fNcC9Mp0Jnhu/YUBlQja08eRha0srsa/JUaI8=; b=mAI9eZEjCDUlvj3KDFp1NyaBzW GZOxRkDFvyC22/Igh78hqud/3y13YPKtthMgTTdzeH43GpKzioGEBYxgZe9P/RscDqJ1P1oPeh7bP XnknCr9mZH4F0WeIR4ocksqyQB/iJZel1TlYX/nMTKUoEGyHzxorXbrmSqJm0fs6ulUh3YxcdgKku /N3r1qGmvZzqEViC/FIcSpTsFtXVWxNbJ4JaY7c2gYA/Ae4Wsy0CbIGyNg3vxBGWFSxSQ8yUTEsRa 6BXoEMZBOBXeFQjErLdOIvtwRXEo307zyi4HVPA3Y3nm1lIiFhnid5Sqk0mWzrlCp8sUUxEk9sSn1 fRPn/+4w==; Received: from wrigleys.postgresql.org ([2a02:16a8:dc51::60]) by mahout.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1x4Ed3-00ELdt-33 for pgsql-bugs@lists.postgresql.org; Wed, 09 Sep 2026 09:30:06 +0000 Received: from localhost ([127.0.0.1] helo=wrigleys.postgresql.org) by wrigleys.postgresql.org with esmtp (Exim 4.98.2) (envelope-from ) id 1x4Ed2-00000003DT4-2ZDf for pgsql-bugs@lists.postgresql.org; Wed, 09 Sep 2026 09:30:04 +0000 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Subject: BUG #19682: Unable to drop a user with default privileges revoked To: pgsql-bugs@lists.postgresql.org From: PG Bug reporting form Cc: ext.solutec.sperraud@grandlyon.com Reply-To: ext.solutec.sperraud@grandlyon.com, pgsql-bugs@lists.postgresql.org Date: Wed, 09 Sep 2026 09:29:50 +0000 Message-ID: <19682-21342a50fcf153e5@postgresql.org> X-Auto-Response-Suppress: All Auto-Submitted: auto-generated List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk The following bug has been logged on the website: Bug reference: 19682 Logged by: Sylvain Perraud Email address: ext.solutec.sperraud@grandlyon.com PostgreSQL version: 18.4 Operating system: RHEL 9.8 Description: =20 Hello, Scenario 1 : create a user alpha then grant default privileges to himself test=3D# create user alpha; CREATE ROLE test=3D# \ddp alpha Default access privileges Owner | Schema | Type | Access privileges -------+--------+------+------------------- (0 rows) test=3D# ALTER DEFAULT PRIVILEGES FOR ROLE alpha GRANT ALL ON TABLES to alpha; ALTER DEFAULT PRIVILEGES test=3D# \ddp alpha Default access privileges Owner | Schema | Type | Access privileges -------+--------+------+------------------- (0 rows) test=3D# drop user alpha; DROP ROLE Conclusion 1 : Drop is working ***************************************************************************= ***************************************************************************= ***************************** Scenario 2 : create a user alpha then revoke default privileges from himself test=3D# create user alpha; CREATE ROLE test=3D# ALTER DEFAULT PRIVILEGES FOR ROLE alpha REVOKE ALL ON TABLES FROM alpha; ALTER DEFAULT PRIVILEGES test=3D# \ddp alpha Default access privileges Owner | Schema | Type | Access privileges -------+--------+-------+------------------- alpha | | table | (none) (1 row) test=3D# drop user alpha; ERROR: role "alpha" cannot be dropped because some objects depend on it DETAIL: owner of default privileges on new relations belonging to role alpha Conclusion 2 : Drop is not working ***************************************************************************= ***************************************************************************= ***************************** Scenario 3 : create a user alpha and beta then grant default privileges to both users test=3D# create user alpha; CREATE ROLE test=3D# create user beta; CREATE ROLE test=3D# ALTER DEFAULT PRIVILEGES FOR ROLE alpha GRANT ALL ON TABLES to be= ta; ALTER DEFAULT PRIVILEGES test=3D# \ddp alpha Default access privileges Owner | Schema | Type | Access privileges -------+--------+-------+--------------------- alpha | | table | beta=3DarwdDxtm/alpha (1 row) test=3D# ALTER DEFAULT PRIVILEGES FOR ROLE alpha GRANT ALL ON TABLES to alpha; ALTER DEFAULT PRIVILEGES test=3D# \ddp alpha Default access privileges Owner | Schema | Type | Access privileges -------+--------+-------+---------------------- alpha | | table | alpha=3DarwdDxtm/alpha+ | | | beta=3DarwdDxtm/alpha (1 row) test=3D# drop user alpha; ERROR: role "alpha" cannot be dropped because some objects depend on it DETAIL: owner of default privileges on new relations belonging to role alpha test=3D# ALTER DEFAULT PRIVILEGES FOR ROLE alpha REVOKE ALL ON TABLES FROM beta; ALTER DEFAULT PRIVILEGES test=3D# \ddp alpha Default access privileges Owner | Schema | Type | Access privileges -------+--------+------+------------------- (0 rows) test=3D# drop user alpha; DROP ROLE Conclusion 3 : Drop is working whereas DEFAULT PRIVILEGES are still granted to alpha