Questions tagged «owner»

1
PostgreSQL-备份数据库并在其他所有者上还原?
我使用以下命令在不同服务器上的数据库上进行了备份,该角色具有与我所需角色不同的角色: pg_dump -Fc db_name -f db_name.dump 然后,我将备份复制到需要还原数据库的另一台服务器上,但是没有用于该数据库的所有者。假设数据库具有owner owner1,但是在另一台服务器上只有owner2我,并且我需要还原该数据库并更改所有者。 还原时我在另一台服务器上执行的操作: createdb -p 5433 -T template0 db_name pg_restore -p 5433 --role=owner2 -d db_name db_name.dump 但是运行还原时,出现以下错误: pg_restore: [archiver (db)] could not execute query: ERROR: role "owner1" does not exist 如何指定它以便更改所有者?还是不可能?
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.