Reputation: 11
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]
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]
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
Upvotes: 1
Views: 6329
Reputation: 1
The following errors do not necessarily appear on your computer, but this increases the probability of fixing them.
postgres
user and give it all permissions in the installation path location, which is especially important for initial writes to the data directory.A good and simple example is to run
net user /add
so that you can use psql right away.
poshrc
in Computer\ HKEY_LOCAL_MACHINE\ Software\ Microsoft\ Command Processor\ Autorun, transfer and move to HKCU!.\<Path to PostgreSQL>\<version>\bin\initdb -D "<Path to PostgreSQL>\<version>\data"
.\<Path to PostgreSQL>\<version>\bin\pg_ctl start -D "<Path to PostgreSQL>\<version>\data"
Upvotes: -1
Reputation: 261
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
Upvotes: 16