Re: Understanding ALTER DEFAULT PRIVILEGES Behavior in PostgreSQL

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Ayush Vatsa <ayushvatsa1810(at)gmail(dot)com>
Cc: "pgsql-general(at)lists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: Understanding ALTER DEFAULT PRIVILEGES Behavior in PostgreSQL
Date: 2025-02-04 19:00:38
Message-ID: CAKFQuwYEwYezVX4RAiszedMo5Zv-nd-VY0Ab=5GDzsNQpMeyQQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tuesday, February 4, 2025, Ayush Vatsa <ayushvatsa1810(at)gmail(dot)com> wrote:
>
> postgres=# ALTER DEFAULT PRIVILEGES IN SCHEMA my_schema REVOKE EXECUTE ON
> FUNCTIONS FROM PUBLIC;
> ALTER DEFAULT PRIVILEGES
>

As the documentation explains:

Default privileges that are specified per-schema are added to whatever the
global default privileges are for the particular object type. This means
you cannot revoke privileges per-schema if they are granted globally
(either by default, or according to a previous ALTER DEFAULT PRIVILEGES command
that did not specify a schema). Per-schema REVOKE is only useful to reverse
the effects of a previous per-schema GRANT.

David J.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Thiemo Kellner 2025-02-04 19:03:27 Re: Lookup tables
Previous Message Ayush Vatsa 2025-02-04 18:49:56 Understanding ALTER DEFAULT PRIVILEGES Behavior in PostgreSQL