Subject: Pg dump of parent table instead of taking child table

From: Sathish Reddy <[email-masked]>
Date: Fri, 13 Sep 2024 17:00:05 +0530

Hi
  We are trying to take parent table backup included all child tables data
into dump plan format.but we are getting failed to achieve.

Please help me on these.

Thanks
Sathishreddy

---

From: Erik Wienhold <[email-masked]>
Date: Fri, 13 Sep 2024 14:54:19 +0200

> into dump plan format.but we are getting failed to achieve.

1) Which Postgres version?

2) What pg_dump options did you use?

3) What output/error do you get?

4) What does the database schema look like?  Are you using table
   inheritance or foreign keys for the parent-child relationship?

-- 
Erik

---

From: Sathish Reddy <[email-masked]>
Date: Fri, 13 Sep 2024 18:41:59 +0530

We are using 14 version
Pg_dump with  -Fp and --loading-via-parent-root option

Database name is better and schema is better. ..

Thanks

Sathishreddy

---

From: Holger Jakobs <[email-masked]>
Date: Fri, 13 Sep 2024 16:09:55 +0200

There is no such option "--loading-via-parent-root"

Check for existing options here: 

https://www.postgresql.org/docs/14/app-pgdump.html
-- 
Holger Jakobs, Bergisch Gladbach 
Tel. +49 178 9759012

---

From: "David G. Johnston" <[email-masked]>
Date: Fri, 13 Sep 2024 07:16:00 -0700

> https://www.postgresql.org/docs/14/app-pgdump.html
It’s actually named —load-via-partition-root ; close enough if going from
memory I’d say…but better still to copy and paste real commands or
reproducible scripts.

David J.

---

From: Erik Wienhold <[email-masked]>
Date: Fri, 13 Sep 2024 18:24:38 +0200

> Database name is better and schema is better. ..

But how are the tables defined, i.e., the CREATE TABLE statements?

Are we talking about table partitions when you're possibly using
--load-via-partition-root (as noted downthread)?

-- 
Erik

---

From: Sathish Reddy <[email-masked]>
Date: Fri, 13 Sep 2024 23:08:36 +0530

Thanks we got solution for these

pg_dump -h
ppbet-betplacement-prod-db-00.chllgfpshkd5.eu-west-1.rds.amazonaws.com -U
postgres -d betplacement -t betplacement.bet --data-only --format=custom
--load-via-partition-root > bet.sql