RE: Proposal: Conflict log history table for Logical Replication

From: "Hayato Kuroda (Fujitsu)" <kuroda(dot)hayato(at)fujitsu(dot)com>
To: 'Amit Kapila' <amit(dot)kapila16(at)gmail(dot)com>
Cc: Zhijie Hou <houzhijie22(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>, shveta malik <shveta(dot)malik(at)gmail(dot)com>, shihao zhong <zhong950419(at)gmail(dot)com>, Dilip Kumar <dilipbalaut(at)gmail(dot)com>, saurabh singh <saurabh(dot)singh214(at)gmail(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Peter Smith <smithpb2250(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 <shvetamalik(at)gmail(dot)com>
Subject: RE: Proposal: Conflict log history table for Logical Replication
Date: 2026-11-25 06:32:58
Message-ID: OS7PR01MB18317700196970B7DF0FA50CBF5432@OS7PR01MB18317.jpnprd01.prod.outlook.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

> Thanks for the review and sorry I forgot to credit you as a reviewer.
> I have pushed the patch.

No problem, others contributed more.

> Yes, the current behavior is intentional and I feel that is
> appropriate. This is because using will make it
> depend on the session that creates it rather than keeping it tied with
> subscriptions.

It's because the default_tablespace has a context PGC_USERSET, right?

> Also, this is a system-managed table, so it seems apt
> to keep it at database's default tablespace.

You meant that conflict log table should be handled as system catalogs which are
created lately, understood. It confirmed that conflict log table can be put at the
same location as catalogs, see [1].

> Agreed. Additionally, we can add a comment on the lines: "Place the
> table in the database's default tablespace, ignoring
> default_tablespace, so its placement does not depend on the session
> that creates it.". What do you think?

Makes sense for me.

[1]:
```
postgres=# # check path of catalogs and conflict log tables first
postgres=# SELECT c.oid::regclass AS catalog,
pg_relation_filepath(c.oid) AS path
FROM pg_class AS c
WHERE c.oid IN (
'pg_catalog.pg_class'::regclass,
'pg_catalog.pg_attribute'::regclass,
'pg_catalog.pg_proc'::regclass,
'pg_conflict.pg_conflict_log_16389'::regclass
)
ORDER BY 1;
catalog | path
-----------------------------------+--------------
pg_attribute | base/5/1249
pg_proc | base/5/1255
pg_class | base/5/1259
pg_conflict.pg_conflict_log_16389 | base/5/16390
(4 rows)

postgres=# # switch connection to run ALTER DATABASE
postgres=# \c template1
You are now connected to database "template1" as user "postgres".
template1=# # change the default tablespace
template1=# ALTER DATABASE postgres SET TABLESPACE tblspc ;
ALTER DATABASE
template1=# # go back to the postgres database
template1=# \c postgres
You are now connected to database "postgres" as user "postgres".
postgres=# # check path again to verify location is changed
postgres=# SELECT c.oid::regclass AS catalog,
pg_relation_filepath(c.oid) AS path
FROM pg_class AS c
WHERE c.oid IN (
'pg_catalog.pg_class'::regclass,
'pg_catalog.pg_attribute'::regclass,
'pg_catalog.pg_proc'::regclass,
'pg_conflict.pg_conflict_log_16389'::regclass
)
ORDER BY 1;
catalog | path
-----------------------------------+-----------------------------------------
pg_attribute | pg_tblspc/16384/PG_20_202611241/5/1249
pg_proc | pg_tblspc/16384/PG_20_202611241/5/1255
pg_class | pg_tblspc/16384/PG_20_202611241/5/1259
pg_conflict.pg_conflict_log_16389 | pg_tblspc/16384/PG_20_202611241/5/16390
(4 rows)
```

Best regards,
Hayato Kuroda
FUJITSU LIMITED

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Zhijie Hou 2026-11-25 06:38:42 Re: Proposal: Conflict log history table for Logical Replication
Previous Message shveta malik 2026-11-25 06:18:45 Re: Proposal: Conflict log history table for Logical Replication