Connecting with psql

Connecting with psql

Depending on the default values used or the environment variables you have set, the following examples show how to access a database via psql:

$ psql -d gpdatabase -h master_host -p 5432 -U gpadmin
$ psql gpdatabase
$ psql
If a user-defined database has not yet been created, you can access the system by connecting to the postgres database. For example:
$ psql postgres




=> SELECT * FROM mytable;

See the Greenplum Reference Guide for information about using the psql client application and SQL commands and syntax.