Setting Advanced Server Environment Variables v12

The graphical installer provides a script that simplifies the task of setting environment variables for Windows users. The script sets the environment variables for your current shell session; when your shell session ends, the environment variables are destroyed. You may wish to invoke pgplus_env.bat from your system-wide shell startup script, so that environment variables are automatically defined for each shell session.

The pgplus_env script is created during the Advanced Server installation process and reflects the choices made during installation. To invoke the script, open a command line and enter:

C:\Program Files\edb\as12\pgplus_env.bat

As the pgplus_env.bat script executes, it sets the following environment variables:

PATH="C:\Program Files\edb\as12\bin";%PATH%
EDBHOME=C:\Program Files\edb\as12
PGDATA=C:\Program Files\edb\as12\data
PGDATABASE=edb
REM @SET PGUSER=enterprisedb
PGPORT=5444
PGLOCALEDIR=C:\Program Files\edb\as12\share\locale

If you have used an installer created by EnterpriseDB to install PostgreSQL, the pg_env script performs the same function:

C:\Progra~1\PostgreSQL\12\pg_env.bat

As the pg_env.bat script executes on PostgreSQL, it sets the following environment variables:

PATH="C:\Program Files\PostgreSQL\12\bin";%PATH%
PGDATA=C:\Program Files\PostgreSQL\12\data
PGDATABASE=postgres
PGUSER=postgres
PGPORT=5432
PGLOCALEDIR=C:\Program Files\PostgreSQL\12\share\locale