Re: "grant usage on schema" confers the ability to execute all user-defined functions in that schema, with needing to grant "execute"

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Bryn Llewellyn <bryn(at)yugabyte(dot)com>
Cc: pgsql-general list <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: "grant usage on schema" confers the ability to execute all user-defined functions in that schema, with needing to grant "execute"
Date: 2022-02-11 21:00:15
Message-ID: CAKFQuwZUuL6ek+6noEg13eXJBqK9WKhQww-wn+pqowf+Qub3UA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, Feb 11, 2022 at 1:46 PM Bryn Llewellyn <bryn(at)yugabyte(dot)com> wrote:

>
>
> *grant usage on schema s to z;revoke execute on function s.f() from z; --
> Yes, really!*
>
> **This surprises me**
>
> The PG doc on, in the "5.7. Privileges" section at
> https://www.postgresql.org/docs/current/ddl-priv.html (under "USAGE"
> following "The available privileges are"), says this:
>
> «
> For schemas, allows access to objects contained in the schema (assuming
> that the objects' own privilege requirements are also met). Essentially
> this allows the grantee to “look up” objects within the schema...
> »
>

> *Is the design of my test-case faulty? Have I found a bug? Or is the doc
> wrong?*
>

WADaD

https://www.postgresql.org/docs/current/ddl-priv.html

"No privileges are granted to PUBLIC by default on tables, table columns,
sequences, foreign data wrappers, foreign servers, large objects, schemas,
or tablespaces. For other types of objects, the default privileges granted
to PUBLIC are as follows: CONNECT and TEMPORARY (create temporary tables)
privileges for databases; ***EXECUTE privilege for functions and procedures
***; and USAGE privilege for languages and data types (including domains)."

David J.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Bryn Llewellyn 2022-02-11 21:44:23 Re: "grant usage on schema" confers the ability to execute all user-defined functions in that schema, with needing to grant "execute"
Previous Message Tom Lane 2022-02-11 20:59:46 Re: "grant usage on schema" confers the ability to execute all user-defined functions in that schema, with needing to grant "execute"