psql is the query tool supplied as a part of the core distribution of PostgreSQL, so it is available and works similarly in all environments. This makes it an ideal choice for developing portable applications and techniques.
psql provides features for use as both an interactive query tool and a scripting tool.
From here on, we will assume that
psql is a sufficient command to allow you access to the PostgreSQL server. This assumes that all of your connection parameters are defaults, which may not be true.
Written in full, the connection parameters would be as follows:
psql –h hostname –p 5432 –d dbname –U username
The default value for the port (
5432. By default,
username are both ...