Skip to content

Establishing a Database Session


Users can connect to WarehousePG using a PostgreSQL-compatible client program, such as psql. Users and administrators always connect to WarehousePG through the coordinator; the segments cannot accept client connections.

In order to establish a connection to the WarehousePG coordinator, you will need to know the following connection information and configure your client program accordingly.

Connection ParameterDescriptionEnvironment Variable
Application nameThe application name that is connecting to the database. The default value, held in the application_name connection parameter is psql.$PGAPPNAME
Database nameThe name of the database to which you want to connect. For a newly initialized system, use the postgres database to connect for the first time.$PGDATABASE
Host nameThe host name of the WarehousePG coordinator. The default host is the local host.$PGHOST
PortThe port number that the WarehousePG coordinator instance is running on. The default is 5432.$PGPORT
User nameThe database user (role) name to connect as. This is not necessarily the same as your OS user name. Check with your WarehousePG administrator if you are not sure what you database user name is. Note that every WarehousePG cluster has one superuser account that is created automatically at initialization time. This account has the same name as the OS name of the user who initialized the WarehousePG cluster (typically gpadmin).$PGUSER

Connecting with psql provides example commands for connecting to WarehousePG.

Parent topic: Accessing the Database