------ 
--- 导出 
pg_dump -h *.*.*.*  -p 5432 -d you_databasename -n you_schema -f you_sqlfile.sql

---- 替换schema 名称
sed -i 's/^SET search_path = oldyou_schemaname, pg_catalog;$/SET search_path = newyou_schemaname, pg_catalog;/' you_sqlfile.sql

---- 没跑过
----sed -i 's/^oldyou_schemaname.$/newyou_schemaname./' you_sqlfile.sql

---- 导入指定数据库下
psql -d you_databasename -U postgres -f you_sqlfile.sql

  

相关文章:

  • 2021-11-02
  • 2021-07-09
  • 2022-12-23
  • 2022-03-01
  • 2022-12-23
  • 2022-01-26
  • 2022-02-07
  • 2021-12-25
猜你喜欢
  • 2022-01-04
  • 2022-12-23
  • 2021-12-26
  • 2021-12-26
  • 2021-04-24
  • 2021-05-13
  • 2022-12-23
相关资源
相似解决方案