BUG #19952: psql \d+ omits nondefault replica identity for partitioned tables
Thread notes
1 note#bug
hackorum-bot#bug
@global #bug
The following bug has been logged on the website:
Bug reference: 19952
Logged by: Faye
Email address: imchifan@mail.com
PostgreSQL version: 19.0
Operating system: Linux/amd64
Description:
psql's \d+ does not display a partitioned table's nondefault replica
identity, although ALTER TABLE accepts the setting and pg_class records it.
The equivalent setting is displayed for an ordinary table.
Run as a superuser.
This can be reproduced with psql -X -f repro.sql:
\set ON_ERROR_STOP on
CREATE TABLE t_regular (id integer);
CREATE TABLE t_partitioned (id integer) PARTITION BY RANGE (id);
ALTER TABLE t_regular REPLICA IDENTITY FULL;
ALTER TABLE t_partitioned REPLICA IDENTITY FULL;
\pset format unaligned
\pset tuples_only on
SELECT relname || '|' || relkind::text || '|' || relreplident::text
FROM pg_class
WHERE relname IN ('t_regular', 't_partitioned')
ORDER BY relname;
\pset format aligned
\pset tuples_only off
\d+ t_regular
\d+ t_partitioned
The catalog query shows that both settings are FULL (`relreplident = 'f'`):
t_partitioned|p|f
t_regular|r|f
The ordinary table's description includes:
Replica Identity: FULL
Access method: heap
The partitioned table's description ends without the corresponding replica
identity line:
Partition key: RANGE (id)
Number of partitions: 0
Since REPLICA IDENTITY FULL is stored for the partitioned table, I expected
its \d+ output to include `Replica Identity: FULL` as it does for the
ordinary table.
Hi,
On Wed, Nov 25, 2026 at 11:22 PM PG Bug reporting form <
noreply@postgresql.org> wrote:
psql's \d+ does not display a partitioned table's nondefault replica
identity, although ALTER TABLE accepts the setting and pg_class records it.
The equivalent setting is displayed for an ordinary table.Run as a superuser.
This can be reproduced with psql -X -f repro.sql:
\set ON_ERROR_STOP on
CREATE TABLE t_regular (id integer);
CREATE TABLE t_partitioned (id integer) PARTITION BY RANGE (id);
ALTER TABLE t_regular REPLICA IDENTITY FULL;
ALTER TABLE t_partitioned REPLICA IDENTITY FULL;\pset format unaligned
\pset tuples_only on
SELECT relname || '|' || relkind::text || '|' || relreplident::text
FROM pg_class
WHERE relname IN ('t_regular', 't_partitioned')
ORDER BY relname;\pset format aligned
\pset tuples_only off
\d+ t_regular
\d+ t_partitionedThe catalog query shows that both settings are FULL (`relreplident = 'f'`):
t_partitioned|p|f
t_regular|r|fThe ordinary table's description includes:
Replica Identity: FULL
Access method: heapThe partitioned table's description ends without the corresponding replica
identity line:Partition key: RANGE (id)
Number of partitions: 0Since REPLICA IDENTITY FULL is stored for the partitioned table, I expected
its \d+ output to include `Replica Identity: FULL` as it does for the
ordinary table.
Thanks for the report and the repro.
Agreed; \d+ currently doesn't display the replica identity for partitioned
tables,
and it makes sense to add it. The setting is already stored and preserved by
pg_dump/pg_restore, and showing it helps catch mismatches between a
partitioned table and its partitions during logical replication, since the
parent's
setting is sent to subscribers when publish_via_partition_root = true.
I am attaching a patch to fix this; thoughts?
--
Thanks :)
Srinath Reddy Sadipiralla
EDB: https://www.enterprisedb.com/