Showing results for 
Search instead for 
Did you mean: 

Start Postgres Service with Enviroment Variables

Level 2 Adventurer

Start Postgres Service with Enviroment Variables



two weeks ago I was asking about how to proper setup python for postgres. You were able to help me by providing a solution by setting the enviroment variables inside the command line.

I have made them permant by adding them to the systems environment variables. Unfortunately this setup messed up my main python installation. (Because both .exe are called python.exe)
So I wanted to ask if there is a possibilty to just set the enviroment variables for the windows service of postgres.


I have already tried to set a registry key `Enviroment` inside the postgres windows service regex section but without success. Putting a modified launch command line string into the windows service location also didn't helped. Because it didnt launched.


Any help is appriciated!



EDB Team Member

Re: Start Postgres Service with Enviroment Variables

Hi Paul,


In the last discussion, we have used below example to set the environment variables for "PYTHON_HOME & LANGUAGE_PACK": 



c:\Program Files\PostgreSQL\11\bin>set PYTHON_HOME=c:\edb\languagepack-11\x64\Python-3.6

c:\Program Files\PostgreSQL\11\bin>set PATH=c:\edb\languagepack-11\x64\Perl-5.26\bin;c:\edb\languagepack-11\x64\Python-3.6;c:\edb\languagepack-11\x64\Tcl-8.6\bin;%PATH%




However, as you mentioned your current python setup is not working. I think this was because your PYTHON_HOME got overwritten with language pack python libraries only.

Hence, Kindly request you to set PYTHON_HOME in the following format:


c:\Program Files\PostgreSQL\11\bin>set PYTHON_HOME="%PYTHON_HOME%; c:\yourexistingpythonlibrarypath"

By this way, you will preserve the language pack python path and add the existing Python libraries as well.


Hope this helps.