我正在尝试将表planet_osm_polygon从一个数据库复制osm到另一个数据库test。我su postgres并执行了pg_dump。
问题:但是我遇到了错误could not change directory to "/root",Password:提示出现了两次!有没有办法以pg_dump登录身份执行root?
root@lalaland:~# su postgres
postgres@lalaland:/root$ pg_dump -h localhost "osm" --table "public.planet_osm_polygon" |
psql -h localhost "test" --table "staging.planet_osm_polygon"
could not change directory to "/root"
could not change directory to "/root"
Password: Password:
更新
问题2:public即使我通过了flag ,也似乎将表复制到了架构中--table="staging.planet_osm_polygon"。为什么不将其复制到架构staging?
—
Nyxynyx
不,但是您的命令行包含
—
dezso
psql -h localhost "test" --table "staging.planet_osm_polygon"
@dezso哦,我没注意到!!我想它一定会一直复制到
—
Nyxynyx
public架构中
这个问题是因为的pgsql /目录不存在,你必须创建在/ var / lib中/ pgsql的这项工作对我来说..亲切的问候海勒姆
—
海勒姆·沃克
psql,这可能是问题#2的原因