On 08/02/2018 11:23 AM, Suresh Raja wrote:
yes ... how can i pass variable * to the function has_schema_privilege(*, 'schema-of-interest', 'usage');

PREPARE schema_user(varchar, varchar) AS SELECT * FROM pg_user
  WHERE has_schema_privilege($1, $2, 'create');

EXECUTE schema_user ('aklaver', 'public');

DEALLOCATE schema_user ;


Thanks!

On Thu, Aug 2, 2018 at 12:58 PM, Tom Lane <[email protected] <mailto:[email protected]>> wrote:

    Suresh Raja <[email protected]
    <mailto:[email protected]>> writes:
     > I'm looking for query which can list all users who have access to a
     > particular schema.

    Something involving

    SELECT ... FROM pg_user
       WHERE has_schema_privilege(usename, 'schema-of-interest', 'usage');

    would probably be what you want.

                             regards, tom lane




--
Adrian Klaver
[email protected]

Reply via email to