请在PostgreSQL中让我们知道如何在不同的模式上备份表。我们有名为"geopostgrest“的db,在名为"1”的架构下(不在公共模式内),我们需要备份表“活动”
请参阅以下文件:
postgres=# \c geopostgrest
You are now connected to database "geopostgrest" as user "postgres".
geopostgrest=# \dt
No relations found.
geopostgrest=# \dt 1.
List of relations
Schema | Name | Type | Owner
--------+---------------------------------+-------+----------
1 | activity | table | postgres
我们尝试了以下命令,但它不起作用。
pg_dump -U postgres -n1 -d geopostgrest -t activity -f activity_05-08-2015.sql
pg_dump: No matching tables were found
我们正在使用PostgreSQL 9.4.4和Ubuntu14.04.2LTS
有人能帮我们吗?
谢谢
发布于 2015-08-06 05:14:02
能够使用以下命令对PostgreSQL中不同模式上的表进行备份,并且其工作正常:
pg_dump -U postgres -t 1.activity -d geopostgrest -f activity_05-08-2015.sql
发布于 2015-08-05 05:38:11
你能试试-n 1
(他们之间的空格)吗?
此外,我也找不到-d
参数。如果需要指定数据库,则只需将其作为最后一个或第一个参数输入即可。
https://serverfault.com/questions/711026
复制