找到 pg_hba.conf 配置文件
编辑文件,放开sa账户权限
host all user1 0.0.0.0/0 md5
#host all sa 0.0.0.0/0 md5
host all guarantee 0.0.0.0/0 md5
执行脚本控制台执行脚本
select 'ALTER TABLE ' || table_name || ' OWNER TO user1;' from information_schema.tables where table_schema='schemaName';
到此原user1账户创建就有了原sa账户创建的表权限
查看数据库模式下占用内存大小
select pg_size_pretty(pg_database_size('scheme));
## 给某个用户赋原来表的权限
GRANT ALL PRIVILEGES ON DATABASE schemaname TO username;
grant usage on schema schemaname to username;
GRANT ALL PRIVILEGES ON all tables in schema schemaname TO username;