PostgreSQL/ClientServerComm Client

Before a client program like createdb, psql, pg_dump, vacuumdb, ... can perform any action on a database, it must establish a connection to that database. To do so, it must provide concrete values for the essential boundary conditions.
 * The IP address or DNS name of the server, where the instance is running.
 * The port on this server, to whom the instance is listening. (The combination of IP address and port identifies the instance. Multiple instances at the same IP address are possible as long as the port is different.)
 * The name of the database within the instance (respective within the cluster).
 * The name of the user (= role) with which the client program wants to work.
 * The password of this user.

You can specify these values in three different ways:
 * As explicit parameters of the client program.
 * As environment variables.
 * As a fixed line of text in the special file pgpass.

Parameters
You can specify the parameters in the usual short (-) or long (--) format of createdb, psql, pg_dump, vacuumdb, and other standard PostgreSQL command-line tools. $ # Example $ psql -h www.dbserver.com --port=5432  .... The parameter names and their meanings are:

If necessary, the client program will prompt for the password.

Environment Variables
As an alternative to the parameter passing, you can define environment variables within your shell.

File 'pgpass'
Instead of using parameters or environment variables as shown above you can store those values in a file. Use one line per definition in the form:

hostname:port:database:username:password The default filename on UNIX systems is  and on Windows:. On UNIX systems the file protections must disallow any access of world or group:.

You can create the file with any text editor. This is not necessary if you use pgAdmin. pgAdmin creates the file automatically after a successful connection and stores the actual connection values.