If you are interested in running commands other than those available in the CLI interface, you can install the standard Postgres PSQL command-line tools. The Amazon CLI tool is clearly focused on management functionality and not on the execution of queries. To connect using the psql
command line, you need three values: -h
(hostname), -p
(port), and -U
(user). You will then be prompted for the password as shown in the following command:
# psql -h <Endpoint> -p 5439 -U <user> There are many other options to pass in files, how you wish to have the output formatted, or setting variables as described here.
The following are the connection options:
-h
,--host=HOSTNAME
: This is the database server host or socket directory (default islocal socket
)-p
,--port=PORT
: This is the database server port (default is5432
)-U
,--username=USERNAME
: This is the database username (default isroot
)-w
,--no-password
: This never prompts for a password-W
,--password...