ฉันพยายามที่จะคัดลอกตารางplanet_osm_polygonจากฐานข้อมูลหนึ่งไปยังอีกosm testฉันและดำเนินการsu postgrespg_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:
UPDATE
ปัญหา # 2:ปรากฏว่าตารางจะถูกคัดลอกลงในสคีแม้ว่าฉันผ่านธงpublic --table="staging.planet_osm_polygon"ทำไมไม่ได้คัดลอกไปยังคีมาstaging?
pg_dumpอยู่จริง ๆ แล้วโทรมาpsqlเหรอ? postgresql.org/docs/9.1/static/app-pgdump.html
psql -h localhost "test" --table "staging.planet_osm_polygon"
publicschema เสมอ
psqlซึ่งอาจเป็นสาเหตุของปัญหา # 2