[英]could not open version file PG_VERSION postgresql pg upgrade
I need some help please, I am upgrading postgresql from v10 to v11 on Windows, but get the following error message: could not open version file: C:/Program Files/PostgresSQL/11/data/PG_VERSION
.我需要一些帮助,我正在 Windows 上将 postgresql 从 v10 升级到 v11,但是收到以下错误消息: could not open version file: C:/Program Files/PostgresSQL/11/data/PG_VERSION
.
Here are the steps taken:以下是采取的步骤:
Stopped both PostgresSQL v10 and PostgresSQL v11 services using使用停止 PostgresSQL v10 和 PostgresSQL v11 服务
services.msc
Set full access control/complete permissions for users for both v10 and v11.为 v10 和 v11 的用户设置完全访问控制/完整权限。
Opened command-line and entered打开命令行并输入
RUNAS /USER:postgres "CMD.EXE
prompted to enter password for user postgres user.提示输入用户 postgres 用户的密码。
New command-line window opens and cd to 'C:\Program Files\PostgreSQL\11'.新命令行 window 打开并 cd 到 'C:\Program Files\PostgreSQL\11'。
pg_upgrade.exe --old-datadir "C:/Program Files/PostgreSQL/10/data" --new-datadir "C:/Program Files/PostgreSQL/11/data" --old-bindir "C:/Program Files/PostgreSQL/10/bin" --new-bindir "C:/Program Files/PostgreSQL/11/bin" --check
On pressing enter I get the above mentioned error.按回车键我得到上述错误。
I am new to the whole process of using PostgreSQL.我不熟悉使用 PostgreSQL 的整个过程。
Any thoughts on what is wrong?对出了什么问题有任何想法吗?
I had to grant \postgres modify access to both the old and the new datadirectory.我必须授予 \postgres modify 对旧数据目录和新数据目录的访问权限。 That solved the problem for me while upgrading from 9.6 to 10这解决了我从 9.6 升级到 10 的问题
I had the same problem.我有同样的问题。 I solved it by not running a cmd as postgres user.我通过不以 postgres 用户身份运行 cmd 来解决它。 Instead I made a passwsord file and set the env PGPASSFILE accordingly: https://www.postgresql.org/docs/11/libpq-pgpass.html相反,我创建了一个密码文件并相应地设置了环境 PGPASSFILE: https://www.postgresql.org/docs/11/libpq-pgpass.ZFC35FDC70D5FC69D269883A822EZEC7
Apparently when running cmd as postgres user, it was some permissions that prohibited the PG_VERSION to be opened显然,当以 postgres 用户身份运行 cmd 时,是一些权限禁止打开 PG_VERSION
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.