Thread: BUG #17836: Why does pg_dump need to add * to dump the full partition table structure
BUG #17836: Why does pg_dump need to add * to dump the full partition table structure
From
PG Bug reporting form
Date:
The following bug has been logged on the website: Bug reference: 17836 Logged by: Why does pg_dump need to add * to dump the full partition table structure Email address: dafoer_x@163.com PostgreSQL version: 15.0 Operating system: centos_x86 Description: Why does pg_dump need to add * to dump the full partition table structure Use case: 1. Create a partition table create table t_native_range (f1 bigint,f2 timestamp default now(), f3 text) partition by range ( f2 ); create table t_native_range_201901 partition of t_native_range for values from ('2019-01-01') to ('2019-02-01'); create table t_native_range_201902 partition of t_native_range for values from ('2019-02-01') to ('2019-03-01'); create table t_native_range_201903 partition of t_native_range for values from ('2019-03-01') to ('2019-04-01'); CREATE INDEX t_native_range_f1_idx ON t_native_range (f1); CREATE INDEX t_native_range_f3_idx ON t_native_range (f3); 2.pg_dump dump the partition table structure pg_dump -d postgres -p 29822 -h 127.0.0.1 -t t_native_range -s 3.There is only the parent table information, so why not also export the child partition information -- -- Name: t_native_range; Type: TABLE; Schema: public; Owner: pg14 -- CREATE TABLE public.t_native_range ( f1 bigint, f2 timestamp without time zone DEFAULT now(), f3 text ) PARTITION BY RANGE (f2); ALTER TABLE public.t_native_range OWNER TO pg14; -- -- Name: t_native_range_f1_idx; Type: INDEX; Schema: public; Owner: pg14 -- CREATE INDEX t_native_range_f1_idx ON ONLY public.t_native_range USING btree (f1); -- -- Name: t_native_range_f3_idx; Type: INDEX; Schema: public; Owner: pg14 -- CREATE INDEX t_native_range_f3_idx ON ONLY public.t_native_range USING btree (f3);