Connecting to an Amazon Redshift cluster using the command line
PSQL is a command-line frontend to PostgreSQL. It allows you to query the data interactively. In this recipe, we will learn how to install psql and run interactive queries.
Getting ready
To complete this recipe, you will need to do the following:
- Install psql (this comes with PostgreSQL). To learn more about using psql, you can refer to https://www.postgresql.org/docs/8.4/static/app-psql.html. Based on your operating system, you can download the corresponding PostgreSQL binary from https://www.postgresql.org/download/.
- If you are using a Windows OS, before running psql, you must set the
PGCLIENTENCODING
environment variable to UTF-8:
set PGCLIENTENCODING=UTF8
- Capture your Amazon Redshift cluster and login credentials.
- Modify the security group attached to the Amazon Redshift cluster to allow connections from...