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.94.2) (envelope-from ) id 1qhc2v-003eZ0-Mb for pgsql-admin@arkaria.postgresql.org; Sat, 16 Sep 2023 20:37:42 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qhc2t-000sCU-Uh for pgsql-admin@arkaria.postgresql.org; Sat, 16 Sep 2023 20:37:39 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qhc2t-000sCE-6y for pgsql-admin@lists.postgresql.org; Sat, 16 Sep 2023 20:37:39 +0000 Received: from mout-u-204.mailbox.org ([2001:67c:2050:101:465::204]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qhc2q-005W8j-0X for pgsql-admin@lists.postgresql.org; Sat, 16 Sep 2023 20:37:38 +0000 Received: from smtp102.mailbox.org (smtp102.mailbox.org [IPv6:2001:67c:2050:b231:465::102]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-u-204.mailbox.org (Postfix) with ESMTPS id 4Rp2tM1Rd1z9sRZ; Sat, 16 Sep 2023 22:37:31 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ewie.name; s=MBO0001; t=1694896651; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=LufCyDm8g7uM8K/MiJ3WL67cCgmHE6kTxDnMB6qOOoc=; b=cazXu6BKNVE594a4xBjGnTdkkn2Di2RkSzOFBAuB2RaZUhl4RVMsUi3gho4AuiCxKmDgsL z+VokhrBj8aPB42GtVU3WtZBQ7qKn1nC01pnW1H0jWkV0mwxEG4a3+W/c/sr2lpo8HUjPE Fzz6ps9hDWqKLUBpXLgckwCiBS+I/KWAFvguvUrn+rvFpv5DZ8bTv68YVVrOfgWqZwRVwi 6ScuKXqtoUI7AzeIyAqZZS2YBEOIDQ8KvYErlolnUjWDci7KebQLpWDHh/mCWwT2JNVn4T 2MK4FHh3uJ8TtHQzM29YxNTb6xi734Dib+wrodk8Wyb9Ryuw3plHITrD6sdeHA== Date: Sat, 16 Sep 2023 22:37:30 +0200 (CEST) From: Erik Wienhold To: Koen De Groote , pgsql-admin@lists.postgresql.org Message-ID: <495059484.82333.1694896650450@office.mailbox.org> In-Reply-To: References: Subject: Re: Completely replacing an old user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Priority: 3 Importance: Normal X-Rspamd-Queue-Id: 4Rp2tM1Rd1z9sRZ List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 16/09/2023 20:27 CEST Koen De Groote wrote: > I am trying to set up a new user for a client application, and thus want to > remove the old user afterward. > > But I'm getting stuck on one last error message: > > ERROR: role "X" cannot be dropped because some objects depend on it > DETAIL: privileges for default privileges on new functions belonging to > role postgres in schema public You must also revoke its default privileges before you can drop a role. That's mentioned in the notes of ALTER DEFAULT PRIVILEGES [1]. > The "new functions" bit is confusing. I've swapped over all the current > functions, but cannot seem to find the appropriate table for privileges on > new functions. psql command \ddp will show you the default privileges. [1] https://www.postgresql.org/docs/16/sql-alterdefaultprivileges.html#SQL-ALTERDEFAULTPRIVILEGES-NOTES -- Erik