BUG #17836: Why does pg_dump need to add * to dump the full partition table structure

From: PG Bug reporting form <noreply(at)postgresql(dot)org>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Cc: dafoer_x(at)163(dot)com
Subject: BUG #17836: Why does pg_dump need to add * to dump the full partition table structure
Date: 2023-03-13 07:44:48
Message-ID: 17836-b247028bebff8821@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

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(at)163(dot)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);

Browse pgsql-bugs by date

  From Date Subject
Next Message Oleksandr Volkovskyi 2023-03-13 08:44:24 disable pipeline mode
Previous Message jitesh tiwari 2023-03-13 07:01:07 Invalid memory allocation error with pg_recvlogical or with libPQ logical connection