From: Joe Conway <mail@joeconway.com>
To: David G. Johnston <david.g.johnston@gmail.com>
To: yanliang lei <msdnchina@163.com>
Cc: PostgreSQL-general <pgsql-general@postgreSQL.org>
Subject: Re: how to check specific user_name have “SELECT ON ALL TABLES IN SCHEMA <tableschema>” privilege or not ?
Date: Mon, 12 Sep 2022 15:23:38 -0400
Message-ID: <9be5eea1-0630-f14a-aeb0-1d30365f4b20@joeconway.com> (raw)
In-Reply-To: <CAKFQuwa8-a7XF6Utdxrrioa1SeEzuXtUJ5PSQ3FKArM4BDUqXQ@mail.gmail.com>
References: <610905d7.1042.1832bec6ed3.Coremail.msdnchina@163.com>
<CAKFQuwa8-a7XF6Utdxrrioa1SeEzuXtUJ5PSQ3FKArM4BDUqXQ@mail.gmail.com>
On 9/11/22 12:03, David G. Johnston wrote:
> On Sunday, September 11, 2022, yanliang lei <msdnchina@163.com
> <mailto:msdnchina@163.com>> wrote:
>
> Dear everyone,
> how to check specific <user_name> have “SELECT ON ALL TABLES IN
> SCHEMA <tableschema>” privilege or not ?
>
>
> This is not an appropriate list to ask general usage questions. We have
> a -general list for those.
(therefore moving thread to pgsql-general)
> But, that isn’t a privilege. Its a grant action. The privilege is just
> select on a table in a schema. So you have to check every table in the
> schema individually. The functions and the catalogs documented to
> retrieve this information - start putting them together into a query.
> I’m unable to go look for the specific details right now.
For an extension that will help you with this, see
https://github.com/CrunchyData/crunchy_check_access
Either use that directly, or see how it gathers the info you are
interested in:
https://github.com/CrunchyData/crunchy_check_access/blob/master/sql/check_access.sql
HTH,
--
Joe Conway
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com
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 using the --to and --cc options:
reply via email
To: pgsql-docs@postgresql.org
Cc: mail@joeconway.com, david.g.johnston@gmail.com, msdnchina@163.com, pgsql-general@postgreSQL.org
Subject: Re: how to check specific user_name have “SELECT ON ALL TABLES IN SCHEMA <tableschema>” privilege or not ?
In-Reply-To: <9be5eea1-0630-f14a-aeb0-1d30365f4b20@joeconway.com>
* 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