Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fj4ik-0003vh-E8 for pgsql-general@arkaria.postgresql.org; Fri, 27 Jul 2018 15:31:59 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fj4ii-0001Ja-OS for pgsql-general@arkaria.postgresql.org; Fri, 27 Jul 2018 15:31:56 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fj4ii-0001JS-9i for pgsql-general@lists.postgresql.org; Fri, 27 Jul 2018 15:31:56 +0000 Received: from aragorn.net-wizard.org ([138.201.127.29] helo=gandalf.net-wizard.org) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fj4ic-00040H-HM for pgsql-general@postgresql.org; Fri, 27 Jul 2018 15:31:55 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.net-wizard.org (Postfix) with ESMTP id 82AD680CA1; Fri, 27 Jul 2018 17:31:46 +0200 (CEST) X-Virus-Scanned: Gentoo amavisd-new at aragorn Received: from aragorn.net-wizard.org ([127.0.0.1]) by localhost (aragorn.net-wizard.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id IrnKshXRbb04; Fri, 27 Jul 2018 17:31:41 +0200 (CEST) Received: from MTEC0211 (mtec-lee-dock-2-133.ethz.ch [129.132.6.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: clavadetscher@swisspug.org) by gandalf.net-wizard.org (Postfix) with ESMTPSA id 78CEC80CA0; Fri, 27 Jul 2018 17:31:37 +0200 (CEST) From: "Charles Clavadetscher" To: =?utf-8?Q?'=C5=81ukasz_Jarych'?= , References: <02ef01d41b3b$1e2fda60$5a8f8f20$@swisspug.org> <031b01d41b5d$dd73a880$985af980$@swisspug.org> <041201d424f0$f6faf5a0$e4f0e0e0$@swisspug.org> <042301d424f3$08142da0$183c88e0$@swisspug.org> In-Reply-To: Subject: RE: Read only to schema Date: Fri, 27 Jul 2018 17:31:30 +0200 Message-ID: <062101d425be$eaa4cd70$bfee6850$@swisspug.org> MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_NextPart_000_0622_01D425CF.AE3342C0" X-Mailer: Microsoft Outlook 15.0 Thread-Index: AQHznPPGGnJz+lyr/RH7IZtKJgF+kQJgXwL7AeXPFJoBa9x9KQGVeTgWAlMCB90CoCAK1AIFlFqZAe1Os7UCNe+kjQFM3nLto8a5JHA= Content-Language: de-ch List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk This is a multipart message in MIME format. ------=_NextPart_000_0622_01D425CF.AE3342C0 Content-Type: multipart/alternative; boundary="----=_NextPart_001_0623_01D425CF.AE3342C0" ------=_NextPart_001_0623_01D425CF.AE3342C0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hi =20 Please notice that in this mailing list it is not customary to top post. =20 From: =C5=81ukasz Jarych [mailto:jaryszek@gmail.com]=20 Sent: Freitag, 27. Juli 2018 12:19 To: Charles Clavadetscher ; = pgsql-general@postgresql.org >> PG-General Mailing List = Subject: Re: Read only to schema =20 Hi, =20 ok i hate this.=20 =20 SELECT datname, datacl FROM pg_database where datname =3D 'AccessLog';=20 =20 \What does it mean? =20 The ACL (Access Control List) contains all the information about which = role can do what on that object, in this case a database and which role = granted the privileges. =20 You can find detailed information in the documentation: https://www.postgresql.org/docs/10/static/sql-grant.html =20 An ACL is an array of aclitem, which again is basically a key/value pair = with an equal sign between the key and the value. In this context the key is the grantee, i.e. the role being granted a = privilege. The value is the list of privileges (see list following the link above) = granted to that role, followed by a slash (/) and the role that granted = the privilege. The list of acronyms is a.o. in the link I gave above. Here for your = convenience: =20 rolename=3Dxxxx -- privileges granted to a role =3Dxxxx -- privileges granted to PUBLIC =20 r -- SELECT ("read") w -- UPDATE ("write") a -- INSERT ("append") d -- DELETE D -- TRUNCATE x -- REFERENCES t -- TRIGGER X -- EXECUTE U -- USAGE C -- CREATE c -- CONNECT T -- TEMPORARY arwdDxt -- ALL PRIVILEGES (for tables, varies for other objects) * -- grant option for preceding privilege =20 /yyyy -- role that granted this privilege =20 If the key is empty, it means that the privilege is granted to public, = i.e. every role. =20 Example: =20 admin=3DCTc/postgres means that role postgres granted Connect (c), = Create (C) and Temporary (T) to role admin. =20 Notice that the granting role may differ from the one you are using, if = you are acting as superuser: =20 =E2=80=9CIf a superuser chooses to issue a GRANT or REVOKE command, the = command is performed as though it were issued by the owner of the = affected object. In particular, privileges granted via such a command = will appear to have been granted by the object owner. (For role = membership, the membership appears to have been granted by the = containing role itself.)=E2=80=9D =20 If the ACL is empty (NULL) then the predefined default privileges apply. =