テーブルplanet_osm_polygonをあるデータベースosmから別のデータベースにコピーしようとしていますtest。私su postgresと実行しましたpg_dump。
問題:ただし、エラーが発生could not change directory to "/root"し、Password:プロンプトが2回表示されます。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フラグを渡したにもかかわらず、テーブルがスキーマにコピーされているようです--table="staging.planet_osm_polygon"。なぜスキーマにコピーされないのstagingですか?
いいえ、ただしコマンドラインには次のものが含まれています
—
dezso
psql -h localhost "test" --table "staging.planet_osm_polygon"
@dezsoああ、気づかなかった!! 私はそれが常に
—
Nyxynyx
publicスキーマにコピーされると思います
この問題は、pgsql /ディレクトリが存在しないためです。/var/lib/pgsqlに作成する必要があります。この作業は私のために行われます。親切にHiram
—
Hiram Walker
psql問題の原因である可能性があります#2