Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita61bff2

Browse files
author
Amit Kapila
committed
De-duplicate the result of pg_publication_tables view.
We show duplicate values for child tables in publications that have bothchild and parent tables and are published with publish_via_partition_rootas false which is not what the user would expect.We decided not to backpatch this as there is no user complaint about thisand it doesn't seem to be a critical issue.Author: Hou ZhijieReviewed-by: Bharath Rupireddy, Amit Langote, Amit KapilaDiscussion:https://postgr.es/m/OS0PR01MB5716E97F00732B52DC2BBC2594989@OS0PR01MB5716.jpnprd01.prod.outlook.com
1 parent814e1d9 commita61bff2

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

‎src/backend/catalog/pg_publication.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -487,6 +487,10 @@ GetPublicationRelations(Oid pubid, PublicationPartOpt pub_partopt)
487487
systable_endscan(scan);
488488
table_close(pubrelsrel,AccessShareLock);
489489

490+
/* Now sort and de-duplicate the result list */
491+
list_sort(result,list_oid_cmp);
492+
list_deduplicate_oid(result);
493+
490494
returnresult;
491495
}
492496

‎src/test/regress/expected/publication.out

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -832,6 +832,14 @@ SELECT * FROM pg_publication_tables;
832832
pub | sch2 | tbl1_part1
833833
(1 row)
834834

835+
-- Table publication that includes both the parent table and the child table
836+
ALTER PUBLICATION pub ADD TABLE sch1.tbl1;
837+
SELECT * FROM pg_publication_tables;
838+
pubname | schemaname | tablename
839+
---------+------------+------------
840+
pub | sch2 | tbl1_part1
841+
(1 row)
842+
835843
DROP PUBLICATION pub;
836844
DROP TABLE sch2.tbl1_part1;
837845
DROP TABLE sch1.tbl1;

‎src/test/regress/sql/publication.sql

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -469,6 +469,10 @@ DROP PUBLICATION pub;
469469
CREATE PUBLICATION pub FOR TABLEsch2.tbl1_part1 WITH (PUBLISH_VIA_PARTITION_ROOT=0);
470470
SELECT*FROM pg_publication_tables;
471471

472+
-- Table publication that includes both the parent table and the child table
473+
ALTER PUBLICATION pub ADD TABLEsch1.tbl1;
474+
SELECT*FROM pg_publication_tables;
475+
472476
DROP PUBLICATION pub;
473477
DROPTABLEsch2.tbl1_part1;
474478
DROPTABLEsch1.tbl1;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp