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 1qhe3a-003keo-KP for pgsql-admin@arkaria.postgresql.org; Sat, 16 Sep 2023 22:46:31 +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 1qhe3Y-001R3k-QC for pgsql-admin@arkaria.postgresql.org; Sat, 16 Sep 2023 22:46:28 +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 1qhe3Y-001R2Q-AM for pgsql-admin@lists.postgresql.org; Sat, 16 Sep 2023 22:46:28 +0000 Received: from sonic322-56.consmr.mail.ne1.yahoo.com ([66.163.189.31]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qhe3P-005XFc-ON for pgsql-admin@lists.postgresql.org; Sat, 16 Sep 2023 22:46:27 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1694904376; bh=egWz0yrD901UqGS5x47MMGvk/f0wrW3nbCmWs4toxOA=; h=Date:From:Reply-To:To:In-Reply-To:References:Subject:From:Subject:Reply-To; b=kdRNVs/V1nidVXwmmro/Jw8jQNm2K3ljon6yaF5hk4nhlN3PZXDtKpEHCw0VDuy1otUNfXMl3d8C5aL9DStauA3aUQvuX2mM1Bo9vYbqDS78gnYi/h74UXoZGhk82zCFSZTdlcO4VmonTBu/PqiWHyAbabc/StEP30cgifIYbGUqKhHkby3yvO4v70jhy9I1hWq+Ve6Jss/MwnRiflgMci6Gpjfa8qTkdIMJuzZk21j29ccrcKau9cnMH/a1lURACLMY2g4JMDVD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sonic-MF: X-Sonic-ID: ce519247-8066-4b60-9022-6c26dc9aabad Received: from sonic.gate.mail.ne1.yahoo.com by sonic322.consmr.mail.ne1.yahoo.com with HTTP; Sat, 16 Sep 2023 22:46:16 +0000 Date: Sat, 16 Sep 2023 22:46:13 +0000 (UTC) From: Pepe TD Vo Reply-To: Pepe TD Vo To: "pgsql-admin@lists.postgresql.org" , Koen De Groote Message-ID: <1539073724.1186174.1694904373735@mail.yahoo.com> In-Reply-To: References: Subject: Re: Completely replacing an old user MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_1186173_1457899949.1694904373733" X-Mailer: WebService/1.1.21797 YMailNorrin Content-Length: 10924 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk ------=_Part_1186173_1457899949.1694904373733 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Sound like this is actually an alias for=C2=A0DROP ROLE. You have to explicitly drop any privileges associated with that user, also = to move its ownership to other roles (or drop the object).reassign owned by= to ;and then=C2=A0drop owned by ;The latter = will remove any privileges granted to the user.https://www.postgresql.org/d= ocs/current/role-removal.html Bach-Nga No one in this world is pure and perfect.=C2=A0 If you avoid people for the= ir mistakes you will be alone. So judge less, love, and forgive more.To cal= l him a dog hardly seems to do him justice though in as much as he had four= legs, a tail, and barked, I admit he was, to all outward appearances. But = to those who knew him well, he was a perfect gentleman (Hermione Gingold) **Live simply **Love generously **Care deeply **Speak kindly.*** Genuinely = rich *** Faithful talent *** Sharing success =20 On Saturday, September 16, 2023 at 02:28:13 PM EDT, Koen De Groote wrote: =20 =20 All, I am trying to set up a new user for a client application, and thus want to= remove the old user afterward. The steps are: 1/ create the new user2/ give the new user all priviliges on database, tabl= e, sequence, function and procedures, just like the old user3/ deply client= application with the new user and credentials 3/ Swap ownership of the databases4/ Remove privileges from the old user5/ = Drop the old user But I'm getting stuck on one last error message: ERROR: =C2=A0role "X" cannot be dropped because some objects depend on it DETAIL: =C2=A0privileges for default privileges on new functions belonging = to role postgres in schema public The "new functions" bit is confusing. I've swapped over all the current fun= ctions, but cannot seem to find the appropriate table for privileges on new= functions. What am I missing here? Regards,Koen De Groote =20 ------=_Part_1186173_1457899949.1694904373733 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

Sound like this is actually an ali= as for DROP ROLE.

You have to explicitly drop any privileges associated = with that user, also to move its ownership to other roles (or drop the obje= ct).
reassign owned by <olduser> to <nnewuser> ;
and then&nbs= p;
drop owned by <olduser>;
The l= atter will remove any privileges granted to the user.


Bach-Nga

No one in this world is pure and perfect.  If you avoid = people for their mistakes you will be alone. So judge less, love, and forgi= ve more.3D"Emoji"3D=3D"Emoji"
<= /div>
To call him a dog hardly seems to do him justice though in as= much as he had four legs, a tail, and barked, I admit he was, to all outwa= rd appearances. But to those who knew him well, he was a perfect gentleman = (Hermione Gingold)

**Live simply **Love generously **Care deeply **Speak kindly.
*** Genuinely rich *** Faithful talent *** = Sharing success




=20
=20
On Saturday, September 16, 2023 at 02:28:13 PM EDT, Koe= n De Groote <kdg.dev@gmail.com> wrote:


All,

I am trying to set up a new user for a client appli= cation, and thus want to remove the old user afterward.

The steps are:

1/ create the new user
<= div>2/ give the new user all priviliges on database, table, sequence, funct= ion and procedures, just like the old user
3/ deply client applic= ation with the new user and credentials
3/ Swap ownership of = the databases
4/ Remove privileges from the old user
5/= Drop the old user

But I'm getting stuck on one la= st error message:


ERROR:  role= "X" cannot be dropped because some objects depend on it
DETAIL:  p= rivileges for default privileges on new functions belonging to role postgre= s in schema public

The "new functions" = bit is confusing. I've swapped over all the current functions, but cannot s= eem to find the appropriate table for privileges on new functions.


What am I missing here?

Regards,
Koen De Groote
------=_Part_1186173_1457899949.1694904373733--