Establishing a Database Session

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

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

Connection Parameter Description Environment Variable
Application name The application name that is connecting to the database. The default value, held in the application_name connection parameter is psql. $PGAPPNAME
Database name The 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 name The host name of the LightDB-A Database coordinator. The default host is the local host. $PGHOST
Port The port number that the LightDB-A Database coordinator instance is running on. The default is 5432. $PGPORT
User name The database user (role) name to connect as. This is not necessarily the same as your OS user name. Check with your LightDB-A administrator if you are not sure what you database user name is. Note that every LightDB-A Database system 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 LightDB-A system (typically gpadmin). $PGUSER

Connecting with psql provides example commands for connecting to LightDB-A Database.

Parent topic: Accessing the Database