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 1qByTU-0006U1-64 for pgsql-admin@arkaria.postgresql.org; Wed, 21 Jun 2023 14:06:20 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1qByTS-0005ol-P8 for pgsql-admin@arkaria.postgresql.org; Wed, 21 Jun 2023 14:06:18 +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 1qByTS-0005o3-ED for pgsql-admin@lists.postgresql.org; Wed, 21 Jun 2023 14:06:18 +0000 Received: from jakobs.com ([85.214.83.89] helo=rs.plausibolo.de) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qByTP-003RQZ-F2 for pgsql-admin@lists.postgresql.org; Wed, 21 Jun 2023 14:06:17 +0000 Received: from localhost (localhost [127.0.0.1]) by rs.plausibolo.de (Postfix) with ESMTP id 0402D3802AB; Wed, 21 Jun 2023 16:06:13 +0200 (CEST) Received: from rs.plausibolo.de ([127.0.0.1]) by localhost (h2367442.stratoserver.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id dEV2_wa2vbgJ; Wed, 21 Jun 2023 16:06:12 +0200 (CEST) Received: from [192.168.178.28] (ip-037-201-152-231.um10.pools.vodafone-ip.de [37.201.152.231]) by rs.plausibolo.de (Postfix) with ESMTPSA id 971513801D4; Wed, 21 Jun 2023 16:06:12 +0200 (CEST) Message-ID: <44912597-d81a-aece-2222-5a2e116dc0e1@jakobs.com> Date: Wed, 21 Jun 2023 16:06:11 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Content-Language: de-DE To: pgsql-admin@lists.postgresql.org References: <310498031.1194425.1687354401566@office.mailbox.org> From: Holger Jakobs Subject: Re: Why do i need to install set_user extension if i can directly grant all required privileges to user? In-Reply-To: <310498031.1194425.1687354401566@office.mailbox.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------lohKO5zmQeoRoqYpjOSCeS25" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --------------lohKO5zmQeoRoqYpjOSCeS25 Content-Type: multipart/mixed; boundary="------------tCPy3KBCLsybT06nQpYHOheo"; protected-headers="v1" From: Holger Jakobs To: pgsql-admin@lists.postgresql.org Message-ID: <44912597-d81a-aece-2222-5a2e116dc0e1@jakobs.com> Subject: Re: Why do i need to install set_user extension if i can directly grant all required privileges to user? References: <310498031.1194425.1687354401566@office.mailbox.org> In-Reply-To: <310498031.1194425.1687354401566@office.mailbox.org> --------------tCPy3KBCLsybT06nQpYHOheo Content-Type: multipart/alternative; boundary="------------MnjEzaoARc3Xdfq3X20cNhw5" --------------MnjEzaoARc3Xdfq3X20cNhw5 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: base64 QW0gMjEuMDYuMjMgdW0gMTU6MzMgc2NocmllYiBFcmlrIFdpZW5ob2xkOg0KPg0KPiBDaGFu Z2luZyByb2xlcyBpcyBhbHJlYWR5IHBvc3NpYmxlIGluIFBvc3RncmVzLiAgWW91IG11c3Qg YmUgYSBtZW1iZXIgb2YgdGhlDQo+IHRhcmdldCByb2xlIG9yIGJlIGEgc3VwZXJ1c2VyIGlu IG9yZGVyIHRvIGNoYW5nZSByb2xlcy4NCg0KVGhpcyBpcyBnb2luZyB0byBjaGFuZ2UgaW4g ZGV0YWlsIGFzIG9mIHZlcnNpb24gMTYgb2YgUG9zdGdyZVNRTC4gWW91IA0KbWF5IGRldGVy bWluZSB3aGV0aGVyIGEgcm9sZSBzd2l0Y2ggaXMgYWxsb3dlZCBvciBub3QuDQoNCkV4Y2Vy cHQgZnJvbSBodHRwczovL3d3dy5wb3N0Z3Jlc3FsLm9yZy9kb2NzLzE2L3NxbC1ncmFudC5o dG1sOg0KDQoiVGhlIHxTRVR8IG9wdGlvbiwgaWYgaXQgaXMgc2V0IHRvIHxUUlVFfCwgYWxs b3dzIHRoZSBtZW1iZXIgdG8gY2hhbmdlIA0KdG8gdGhlIGdyYW50ZWQgcm9sZSB1c2luZyB0 aGUgfFNFVCBST0xFfCANCjxodHRwczovL3d3dy5wb3N0Z3Jlc3FsLm9yZy9kb2NzLzE2L3Nx bC1zZXQtcm9sZS5odG1sPiBjb21tYW5kLiBJZiBhIA0Kcm9sZSBpcyBhbiBpbmRpcmVjdCBt ZW1iZXIgb2YgYW5vdGhlciByb2xlLCBpdCBjYW4gdXNlIHxTRVQgUk9MRXwgdG8gDQpjaGFu Z2UgdG8gdGhhdCByb2xlIG9ubHkgaWYgdGhlcmUgaXMgYSBjaGFpbiBvZiBncmFudHMgZWFj aCBvZiB3aGljaCBoYXMgDQp8U0VUIFRSVUV8LiBUaGlzIG9wdGlvbiBkZWZhdWx0cyB0byB8 VFJVRXwuIg0KDQoNCg0KLS0gDQpIb2xnZXIgSmFrb2JzLCBCZXJnaXNjaCBHbGFkYmFjaCwg VGVsLiArNDktMTc4LTk3NTkwMTINCg0K --------------MnjEzaoARc3Xdfq3X20cNhw5 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Am 21.06.23 um 15:33 schrieb Erik Wienhold:
Changing roles is already po=
ssible in Postgres.  You must be a member of the
target role or be a superuser in order to change roles. 

This is going to change in detail as of version 16 of PostgreSQL. You may determine whether a role switch is allowed or not.

Excerpt from https://www.postgresql.org/docs/= 16/sql-grant.html:

"The SET option, if it is set to TRUE, allows the member to change to the= granted role using the SET ROLE command. If a role is an indirect member of another role, it can use SET ROLE to change to that role only if there is a chain of grants each of which has SET TRUE. This option defaults to TRUE."



--=20
Holger Jakobs, Bergisch Gladbach, Tel. +49-178-9759012
--------------MnjEzaoARc3Xdfq3X20cNhw5-- --------------tCPy3KBCLsybT06nQpYHOheo-- --------------lohKO5zmQeoRoqYpjOSCeS25 Content-Type: application/pgp-signature; name="OpenPGP_signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="OpenPGP_signature" -----BEGIN PGP SIGNATURE----- wmMEABEIACMWIQScuJCxWJK1p5BOebGKV5yTsxlhugUCZJMD0wUDAAAAAAAKCRCKV5yTsxlhuoz4 AKCmv4Fw6ldNbeDj8iRSaIp680bkHACgv6ql6Wpq2dhXvbwK0Be1OP/rfwk= =qNjy -----END PGP SIGNATURE----- --------------lohKO5zmQeoRoqYpjOSCeS25--