How dump table with partitions to single file as one table?

1k Views Asked by At

I need to make a dump main table with tables-partitions in one file. Is it possible to do this with some commands in postgresql console or with pg_dump?

Thanks.

1

There are 1 best solutions below

0
On

Something like this should work. It will recreate the table AND partitions :

 pg_dump --username=uname -t "table_name" --file=filename.sql db_name