在PostgreSQL中,分区表数据不会使用pg_restore进行恢复



需要帮助!!

当我要恢复分区表使用:

pg_restore -U (username) -d (Database) -p (port_number) -t (partition_table) -f (filename)

结果是成功的,但分区表中的数据没有恢复,有人能帮我吗?

当指定-t时,pg_restore不会尝试转储所选表可能依赖的任何其他数据库对象。因此,无法保证特定分区表转储的结果能够成功恢复

但是,您可以使用进行转储

pg_dump--主机=主机名--用户名=用户-t";child_table_*"--仅数据--文件=dump_out.sql数据库名

然后恢复它,这可能是设计决策的结果,即在SQL级别上使分区作为单独的表可见。

请参考:https://www.postgresql.org/docs/13/app-pgrestore.htmlhttps://www.postgresql.org/docs/11/app-pgdump.html

最新更新