I have a partition table that I created UNLOGGED
. I'm using pg_partman to manage the partition. I then proceeded to load data into it with a COPY command.
Afterwards, I ran an alter table set logged on the parent table but the table still shows as UNLOGGED
along with all its children.
Is this broken?
You can execute these commands to see the issue:
CREATE UNLOGGED TABLE customers(cust_id bigint NOT NULL,cust_name varchar(32) NOT NULL,cust_address text,
cust_country text)PARTITION BY LIST(cust_country);
CREATE UNLOGGED TABLE customer_ind PARTITION OF customers FOR VALUES IN ('ind');
CREATE UNLOGGED TABLE customer_jap PARTITION OF customers FOR VALUES IN ('jap');
CREATE UNLOGGED table customers_def PARTITION OF customers DEFAULT;
INSERT INTO customers VALUES (2039,'Puja','Hyderabad','ind');
INSERT INTO customers VALUES (4499,'Tony','Arizona','USA');
\d+ customers
checkpoint;
alter table customers set logged ;
\d+ customers;
Throughout the display of the table details the UNLOGGED
status doesn't change when running the ALTER TABLE
command against the parent table. But even when all the child tables have been SET LOGGED
, I'm still not able to change this on the parent table. Tools like pg_partman will look to the parent table to create the child tables with the "correct" properties.