psql(1) -h cedar-pgsql-vm -d david_db%0A david_db%3D%3E -- List names of tables in your database%0A david_db%3D%3E %5Cdt%0A david_db%3D%3E ... Issue SQL commands. See below for more information.%0A david_db%3D%3E -- Quit%0A david_db%3D%3E %5Cq
PostgreSQL interactive terminal
-h hostname

--host hostname
       Specifies the host name of the machine on which the server is running. If the value begins with  a
       slash, it is used as the directory for the Unix-domain socket.
-d dbname

--dbname dbname
       Specifies the name of the database to connect to. This is equivalent to specifying dbname  as  the
       first non-option argument on the command line.

       If this parameter contains an = sign, it is treated as a conninfo string. See in the documentation
       for more information.
psql [ option... ]  [ dbname
 [ username ]  ]

-d dbname

--dbname dbname
       Specifies the name of the database to connect to. This is equivalent to specifying dbname  as  the
       first non-option argument on the command line.

       If this parameter contains an = sign, it is treated as a conninfo string. See in the documentation
       for more information.

-U username

--username username
       Connect to the database as the user username instead of the default.  (You must have permission to
       do so, of course.)
source manpages: psql