Environment variables
This page lists the environment variables that Greengage DB uses.
Set them in the gpadmin user’s startup shell profile (such as ~/.bashrc or ~/.bash_profile) on the master and standby master hosts.
Alternatively, define them in /etc/profile if you want to set them for all users.
For instructions on setting the variables after Greengage DB installation, see Set Greengage DB environment variables.
The variables fall into two categories:
Required environment variables
The following environment variables must be set on the master and standby master hosts for Greengage DB to work correctly.
GPHOME, PATH, and LD_LIBRARY_PATH can be set by sourcing the greengage_path.sh file from the Greengage DB installation directory as shown in Build and install Greengage DB.
GPHOME
The directory where Greengage DB is installed, for example, /usr/local/gpdb:
$ export GPHOME=/usr/local/gpdb
LD_LIBRARY_PATH
The location where the dynamic linker should search for shared libraries used by Greengage DB and PostgreSQL. Typically, it is the lib subdirectory of the Greengage DB installation directory:
$ export LD_LIBRARY_PATH=/usr/local/gpdb/lib
MASTER_DATA_DIRECTORY
The directory where the master data is stored. See Create the data storage areas and Run the initialization utility for complete instructions on creating this directory.
$ export MASTER_DATA_DIRECTORY=/data1/master/gpseg-1
PATH
The system path (PATH environment variable) must include the location of Greengage DB utilities — the bin subdirectory of the Greengage DB installation directory:
$ export PATH=/usr/local/gpdb/bin:$PATH
Optional environment variables
The following are standard PostgreSQL environment variables, which are also recognized by Greengage DB. You may want to add the connection-related environment variables to your profile for convenience, so you do not have to type as many options on the command line for client connections. For more information on using these variables, see Environment Variables in the PostgreSQL documentation.
Environment variables listed below should be set on the Greengage DB master host only.
PGAPPNAME
The name of the application that is usually set by an application when it connects to the server.
This name is displayed in the pg_stat_activity view and in log entries.
The PGAPPNAME environment variable behaves the same as the application_name connection parameter.
The name cannot be longer than 63 characters.
PGDATABASE
The name of the default database to use when connecting.
PGHOST
The Greengage DB master host name.
PGHOSTADDR
The numeric IP address of the master host.
This can be set instead of or in addition to PGHOST to avoid DNS lookup overhead.
PGPASSWORD
The password used if the server demands password authentication.
Use of this environment variable is not recommended for security reasons: some operating systems allow non-root users to see process environment variables via ps.
Consider storing the password in ~/.pgpass or another file passed in PGPASSFILE instead.
PGPASSFILE
The name of the password file to use for lookups. If not set, it defaults to ~/.pgpass. See Password File in the PostgreSQL documentation for more information.
PGOPTIONS
Sets additional configuration parameters for the Greengage DB master server.
PGPORT
The port number of the Greengage DB server on the master host.
The default port is 5432.
PGUSER
The name of the Greengage DB user to use for connection.
PGDATESTYLE
Sets the default style of date/time representation for a session.
Equivalent to SET datestyle TO ….
PGTZ
Sets the default time zone for a session.
Equivalent to SET timezone TO ….
PGCLIENTENCODING
Sets the default client character set encoding for a session.
Equivalent to SET client_encoding TO ….