| From: | shveta malik <shveta(dot)malik(at)gmail(dot)com> |
|---|---|
| To: | Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> |
| Cc: | PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Dilip Kumar <dilipbalaut(at)gmail(dot)com>, Nisha Moond <nisha(dot)moond412(at)gmail(dot)com>, shveta malik <shvetamalik(at)gmail(dot)com> |
| Subject: | Re: ALTER DEFAULT PRIVILEGES IN SCHEMA pg_conflict silently has no effect |
| Date: | 2026-12-02 12:11:42 |
| Message-ID: | CAJpy0uDZC5ecDatjSNKw=9DTp++MiA+2mZqmTQ0tqsciKLGCdw@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
On Wed, Dec 2, 2026 at 3:53 PM Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> wrote:
>
> On Wed, Dec 2, 2026 at 10:08 AM shveta malik <shveta(dot)malik(at)gmail(dot)com> wrote:
> >
> > Attached is the doc patch. I have tried to add a general (but brief)
> > note about CLT privileges. Let me know what you think.
> >
>
> How about being explicit about the privileges INSERT/UPDATE will have
> no effect, something like attached?
>
I agree it is useful to mention that INSERT and UPDATE grants have no
effect, but the new sentence is not accurate in two ways:
"Only SELECT, DELETE, and TRUNCATE can be used by non-superusers on this table"
1)
MAINTAIN can also be used. A non-superuser with MAINTAIN on the CLT
can run VACUUM and ANALYZE on it:
postgres=# GRANT MAINTAIN ON pg_conflict_log_16402 to r_maint;
GRANT
postgres=# set role r_maint;
SET
postgres=> vacuum pg_conflict_log_16402;
VACUUM
postgres=> analyze pg_conflict.pg_conflict_log_16402;
ANALYZE
2)
Slightly more misleading point is: "by non-superusers," which implies
a superuser can do more, but INSERT and UPDATE are rejected for
superusers too:
postgres=# INSERT INTO pg_conflict.pg_conflict_log_16402 (relname) VALUES ('x');
ERROR: cannot modify or insert data into conflict log table
"pg_conflict_log_16402"
DETAIL: Conflict log tables are system-managed and only support
cleanup using DELETE or TRUNCATE.
How about something like this:
The conflict log table is owned by the subscription owner. To allow
other roles to access it, privileges on it must be granted with GRANT;
default privileges set with ALTER DEFAULT PRIVILEGES are not applied
to it. Only the system can add or change rows in the table, so
granting INSERT or UPDATE has no effect. Rows can be removed with
DELETE or TRUNCATE. Privileges granted on the table are lost if the
table is dropped, for example when conflict_log_destination is changed
to log.
~~
(I can modify the patch once we conclude on the text).
thanks
Shveta
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Greg Burd | 2026-12-02 12:29:05 | Re: Interrupts vs signals |
| Previous Message | Nitin Motiani | 2026-12-02 12:06:21 | Re: [PATCH v1] Fix for Bug#19724 - ALTER TYPE ... ALTER ATTRIBUTE triggers internal error for base type of domain with check |