简体   繁体   中英

Can not run PostgreSQL by pg_ctl

I'm new in PostgreSQL, every thing worked fine until unexpected restart, now when I trying to run postgres by this command

>pg_ctl.exe start

it says:

The program "postgres" was found by "C:\Program Files\PostgreSQL\13\bin/pg_ctl.exe" but was not the same version as pg_ctl. Check your installation.

the version of postgres and pg_ctl.exe are same (both of them: 13.1)

[command line image]

1

I've tried another way, I try to run postgres service in windows services it run and stopped immediately and shows a warning
[warning image]

2

so I checked logs(in windows event viewer)and it said:

FATAL: XX000: C:\Program Files\PostgreSQL\13\bin\postgres.exe: could not locate matching postgres executable LOCATION: getInstallationPaths, d:\pginstaller_13.auto\postgres.windows-x64\src\backend\postmaster\postmaster.c:1489

OS: windows server 2019

PostgreSQL Version: 13

In my case I tried all the solutions I found online. None worked. Dozens of reinstall tries.

Then I remembered that I changed one parameter in the registry to better display the local language in cmd.

Returning the value of the command line encoding registry value solved the problem in my case.

Change your registry value to empty:

HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor\Autorun

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM