表所有者一括变更

select 'alter table public.'|| tablename ||' owner to appuser;' from pg_tables where tableowner='postgres' and schemaname='public';

 

改变操作数据库

HBS=# \c TEST;

 

查看所有表

HCS=# \dt;

 

查看表结构

HCS=# \d tablename;

 

批量执行SQL

psql -d db1 -U userA -f E://p/xxx.sql

 本地数据库迁移到RDS阿里云数据库

1,本地数据库备份

pg_dump -U William -h localhost -p 3433 -d pg001 -f pg001.sql

2,数据库迁移

psql -U username -h hostname -d desintationdb -p port -f dumpfilename.sql

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-12-27
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-01-03
  • 2021-09-14
  • 2021-11-03
  • 2022-12-23
  • 2021-07-07
  • 2022-12-23
  • 2022-03-01
相关资源
相似解决方案