diff options
author | Amit Kapila <akapila@postgresql.org> | 2021-12-08 11:15:25 +0530 |
---|---|---|
committer | Amit Kapila <akapila@postgresql.org> | 2021-12-08 11:15:25 +0530 |
commit | a61bff2bf479cfebda18a1655323eec1b19370de (patch) | |
tree | fe6a15de861f821d94e090116567424ac9aae72e /src/backend | |
parent | 814e1d9ff7a853b16a544a244bfa92e8388be248 (diff) | |
download | postgresql-a61bff2bf479cfebda18a1655323eec1b19370de.tar.gz postgresql-a61bff2bf479cfebda18a1655323eec1b19370de.zip |
De-duplicate the result of pg_publication_tables view.
We show duplicate values for child tables in publications that have both
child and parent tables and are published with publish_via_partition_root
as false which is not what the user would expect.
We decided not to backpatch this as there is no user complaint about this
and it doesn't seem to be a critical issue.
Author: Hou Zhijie
Reviewed-by: Bharath Rupireddy, Amit Langote, Amit Kapila
Discussion: https://postgr.es/m/OS0PR01MB5716E97F00732B52DC2BBC2594989@OS0PR01MB5716.jpnprd01.prod.outlook.com
Diffstat (limited to 'src/backend')
-rw-r--r-- | src/backend/catalog/pg_publication.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/backend/catalog/pg_publication.c b/src/backend/catalog/pg_publication.c index 63579b2f82c..b40293fcb31 100644 --- a/src/backend/catalog/pg_publication.c +++ b/src/backend/catalog/pg_publication.c @@ -487,6 +487,10 @@ GetPublicationRelations(Oid pubid, PublicationPartOpt pub_partopt) systable_endscan(scan); table_close(pubrelsrel, AccessShareLock); + /* Now sort and de-duplicate the result list */ + list_sort(result, list_oid_cmp); + list_deduplicate_oid(result); + return result; } |