Closed james-johnston-thumbtack closed 2 years ago
Confirming this is missing. Will try to account for this in the next update.
FYI, in PG14 publications are automatically handled within PostgreSQL itself for native partitioning so if you add the parent table to the publication before you run create_parent()
it should automatically add all children. You can see in the example below I didn't use the p_publication
flag to the create function and all child tables still are in publication.
keith@keith=# CREATE PUBLICATION partman_test_publication;
CREATE PUBLICATION
keith@keith=# create schema partman_test;
CREATE SCHEMA
keith@keith=# CREATE TABLE partman_test.time_taptest_table (col1 int, col2 text default 'stuff', col3 timestamptz NOT NULL DEFAULT now()) PARTITION BY RANGE (col3);
CREATE TABLE
keith@keith=# ALTER PUBLICATION partman_test_publication ADD TABLE partman_test.time_taptest_table ;
ALTER PUBLICATION
keith@keith=# SELECT partman.create_parent('partman_test.time_taptest_table', 'col3', 'native', 'daily');
create_parent
---------------
t
(1 row)
keith@keith=# select * from pg_publication_tables where pubname = 'partman_test_publication';
pubname | schemaname | tablename
--------------------------+--------------+--------------------------------
partman_test_publication | partman_test | time_taptest_table_p2021_11_22
partman_test_publication | partman_test | time_taptest_table_p2021_11_23
partman_test_publication | partman_test | time_taptest_table_p2021_11_24
partman_test_publication | partman_test | time_taptest_table_p2021_11_25
partman_test_publication | partman_test | time_taptest_table_p2021_11_26
partman_test_publication | partman_test | time_taptest_table_p2021_11_27
partman_test_publication | partman_test | time_taptest_table_p2021_11_28
partman_test_publication | partman_test | time_taptest_table_p2021_11_29
partman_test_publication | partman_test | time_taptest_table_p2021_11_30
partman_test_publication | partman_test | time_taptest_table_default
(10 rows)
Version 4.6.1 has been released with a fix for this. Apologies for the delay on the release.
When calling
create_parent
with a publication name, the default partition is not included in the publication. Example:then run the following in psql to print publications:
Notably absent from the publication: the default
test_table_default
partition. I was expecting it to be there...