Search code examples
postgresqldatabase-backupsdatabase-partitioning

How to backup a partitioned table in PostgresSQL 10


Is it possible to make a backup of a specific partitioned table with PostgreSQL 10?

When using:

sudo pg_dump -Fc -f "/home/schema.backup" -t schema.partitioned_table dbname

I am only getting the skeleton of the base table, without any values and without any partitions.

I also couldn't find anything in the extensive documentation.


Solution

  • You'd have to use -t for all partitions.

    This is probably a consequence of the design decision to have partitions visible as individual tables on the SQL level.