Re: Proposal: Conflict log history table for Logical Replication

From: shveta malik <shveta(dot)malik(at)gmail(dot)com>
To: Peter Smith <smithpb2250(at)gmail(dot)com>
Cc: Dilip Kumar <dilipbalaut(at)gmail(dot)com>, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, vignesh C <vignesh21(at)gmail(dot)com>, Nisha Moond <nisha(dot)moond412(at)gmail(dot)com>, Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>, Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, shveta malik <shveta(dot)malik(at)gmail(dot)com>
Subject: Re: Proposal: Conflict log history table for Logical Replication
Date: 2026-06-26 04:14:42
Message-ID: CAJpy0uCe=NYyUrDYYdPET_P_zK_FNW4tYsjMnAnPwte0owwYew@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Jun 26, 2026 at 9:14 AM Peter Smith <smithpb2250(at)gmail(dot)com> wrote:
>
> A question for v58-0002.
>
> ======
> src/test/regress/expected/subscription.out
>
> +-- Trying to create a new table manually in the pg_conflict namespace
> +-- This should fail as the namespace is reserved for conflict log tables
> +CREATE TABLE pg_conflict.manual_table (id int);
> +ERROR: permission denied for schema pg_conflict
> +LINE 1: CREATE TABLE pg_conflict.manual_table (id int);
> + ^
>
> Why is that error very different from the error received when
> attempting the same thing for `pg_catalog` schema?
> Shouldn't the errors in both cases be almost the same?
>
> Here:
> - LINE is shown
> - A schema error happens instead of a create table error
>
> OTOH, the similar case for pg_catalog looks like:
> test_pub=# create table pg_catalog.t1(a int);
> ERROR: permission denied to create "pg_catalog.t1"
> DETAIL: System catalog modifications are currently disallowed.
>

To prevent the creation of other objects such as operators, types,
functions, extensions, views etc in the pg_conflict schema, a check
was added to pg_namespace_aclmask_ext() to reject any object creation
within that schema. As a result, the earlier table-specific error
became redundant, which explains the difference between the two error
messages. I agree that the previous error message was slightly better,
but to avoid introducing special-case checks in multiple places, it
makes more sense to enforce the restriction centrally during the
schema permission check itself. The new error is consistent for all
such object creations inside the conflict schema.

thanks
Shveta

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Chao Li 2026-06-26 04:38:49 Re: Small patch to improve safety of utf8_to_unicode().
Previous Message Bertrand Drouvot 2026-06-26 04:10:57 Re: In core use of RegisterXactCallback() and RegisterSubXactCallback()