pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Charles Clavadetscher <clavadetscher@swisspug.org>
To: 'Łukasz Jarych' <jaryszek@gmail.com>
To: pgsql-general@postgresql.org
Subject: RE: Read only to schema
Date: Fri, 27 Jul 2018 17:31:30 +0200
Message-ID: <062101d425be$eaa4cd70$bfee6850$@swisspug.org> (raw)
In-Reply-To: <CAGv31oepnaD+8ke457vQ7C7x5egmbEEhEcgwMHeqAMxRMfA25w@mail.gmail.com>
References: <CAGv31odWvR7=_VPR=wVNkK3nNh5EHfEyEuMSUHW0TNFdHVjnXw@mail.gmail.com>
	<CAGv31odLZfO12niaO8KJYzm0V5NDExZHyCcGiGkOZzpj_fvkZA@mail.gmail.com>
	<CAGv31odcvi8GVXU3CZYEONCKHo_BmB3Qo5ZQy3XFf9TUyN8fpA@mail.gmail.com>
	<02ef01d41b3b$1e2fda60$5a8f8f20$@swisspug.org>
	<CAGv31oea+sd=BEZi3of40hOb056tfdSQMr=c6gGp2pc2KpL49Q@mail.gmail.com>
	<031b01d41b5d$dd73a880$985af980$@swisspug.org>
	<CAGv31oewbB-UJKEet4am2Vohncocrghbj05M8NWQ2FjJcxuWNA@mail.gmail.com>
	<041201d424f0$f6faf5a0$e4f0e0e0$@swisspug.org>
	<042301d424f3$08142da0$183c88e0$@swisspug.org>
	<CAGv31of9SjiFn7JqV10EDaT1T_psMXq9-0MgQYP+Sxq-UF56hg@mail.gmail.com>
	<CAGv31oepnaD+8ke457vQ7C7x5egmbEEhEcgwMHeqAMxRMfA25w@mail.gmail.com>

Hi

 

Please notice that in this mailing list it is not customary to top post.

 

From: Łukasz Jarych [mailto:jaryszek@gmail.com] 
Sent: Freitag, 27. Juli 2018 12:19
To: Charles Clavadetscher <clavadetscher@swisspug.org>; pgsql-general@postgresql.org >> PG-General Mailing List <pgsql-general@postgresql.org>
Subject: Re: Read only to schema

 

Hi,

 

ok i hate this. 

 

SELECT datname, datacl FROM pg_database where datname = 'AccessLog'; 

 



\What does it mean?

 

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.

 

You can find detailed information in the documentation:

https://www.postgresql.org/docs/10/static/sql-grant.html

 

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:

 

rolename=xxxx -- privileges granted to a role

        =xxxx -- privileges granted to PUBLIC

 

            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

 

        /yyyy -- role that granted this privilege

 

If the key is empty, it means that the privilege is granted to public, i.e. every role.

 

Example:

 

admin=CTc/postgres means that role postgres granted Connect (c), Create (C) and Temporary (T) to role admin.

 

Notice that the granting role may differ from the one you are using, if you are acting as superuser:

 

“If 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.)”

 

If the ACL is empty (NULL) then the predefined default privileges apply. =

view thread (16+ messages)  latest in thread

Message-ID: <062101d425be$eaa4cd70$bfee6850$@swisspug.org>
Permalink:  ../062101d425be$eaa4cd70$bfee6850$@swisspug.org/
Also on:    postgresql.org/message-id/062101d425be$eaa4cd70$bfee6850$@swisspug.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: clavadetscher@swisspug.org, jaryszek@gmail.com
  Subject: Re: Read only to schema
  In-Reply-To: <062101d425be$eaa4cd70$bfee6850$@swisspug.org>
  References: <CAGv31odWvR7=_VPR=wVNkK3nNh5EHfEyEuMSUHW0TNFdHVjnXw@mail.gmail.com> <CAGv31odLZfO12niaO8KJYzm0V5NDExZHyCcGiGkOZzpj_fvkZA@mail.gmail.com> <CAGv31odcvi8GVXU3CZYEONCKHo_BmB3Qo5ZQy3XFf9TUyN8fpA@mail.gmail.com> <02ef01d41b3b$1e2fda60$5a8f8f20$@swisspug.org> <CAGv31oea+sd=BEZi3of40hOb056tfdSQMr=c6gGp2pc2KpL49Q@mail.gmail.com> <031b01d41b5d$dd73a880$985af980$@swisspug.org> <CAGv31oewbB-UJKEet4am2Vohncocrghbj05M8NWQ2FjJcxuWNA@mail.gmail.com> <041201d424f0$f6faf5a0$e4f0e0e0$@swisspug.org> <042301d424f3$08142da0$183c88e0$@swisspug.org> <CAGv31of9SjiFn7JqV10EDaT1T_psMXq9-0MgQYP+Sxq-UF56hg@mail.gmail.com> <CAGv31oepnaD+8ke457vQ7C7x5egmbEEhEcgwMHeqAMxRMfA25w@mail.gmail.com> <062101d425be$eaa4cd70$bfee6850$@swisspug.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox