简体   繁体   English

无法打开版本文件 PG_VERSION postgresql pg 升级

[英]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:以下是采取的步骤:

  1. Stopped both PostgresSQL v10 and PostgresSQL v11 services using使用停止 PostgresSQL v10 和 PostgresSQL v11 服务

    services.msc
  2. Set full access control/complete permissions for users for both v10 and v11.为 v10 和 v11 的用户设置完全访问控制/完整权限。

  3. Created 'postgres' user account with full admin rights.创建具有完全管理员权限的“postgres”用户帐户。
  4. Opened command-line and entered打开命令行并输入

    RUNAS /USER:postgres "CMD.EXE

    prompted to enter password for user postgres user.提示输入用户 postgres 用户的密码。

  5. New command-line window opens and cd to 'C:\Program Files\PostgreSQL\11'.新命令行 window 打开并 cd 到 'C:\Program Files\PostgreSQL\11'。

  6. Entered the following:输入以下内容:
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.

相关问题 PostgreSQL 14.5 pg_read_binary_file 无法打开文件进行读取:参数无效 - PostgreSQL 14.5 pg_read_binary_file could not open file for reading: Invalid argument 是否可以使用 pg_upgrade 将 postgresql 从 9.4 升级到 13.3? - is it possible to upgrade postgresql from 9.4 to 13.3 using pg_upgrade? 使用 pg_upgrade 从 PostgreSQL 10 到 12 时出错 - Error using pg_upgrade going from PostgreSQL 10 to 12 Windows 上的 pg_upgrade 无法写入日志文件 pg_upgrade_internal.log - pg_upgrade on Windows cannot write to log file pg_upgrade_internal.log PostgreSQL:在Windows上构建skytools和pg_top - Postgresql: build skytools and pg_top on windows 当入侵者更改pg_hba.conf文件时,是否可以通过pgAdmin保护PostgreSQL访问? - Is there any way to protect PostgreSQL access via pgAdmin when an intruder changes pg_hba.conf file? 编码问题 pg_dump [PostgreSQL] - Encoding issue pg_dump [PostgreSQL] 无法通过 pg_ctl 运行 PostgreSQL - Can not run PostgreSQL by pg_ctl rake db:structure:dump失败postgresql没有这样的文件或目录pg_dump - rake db:structure:dump fails postgresql no such file or directory pg_dump 错误:查阅“pg_upgrade_dump_1.log”的最后几行 - Error: Consult the last few lines of "pg_upgrade_dump_1.log"
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM