Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to run Queries on Redshift Database using AWS CLI

I want to run queries by passing them as string to some supported command of AWS through its CLI.

I can see that the commands specific to AWS Redshift mentioned doesnt have anything which says that it can execute commands remotely

Link : https://docs.aws.amazon.com/cli/latest/reference/redshift/index.html

Need help on this.

like image 463
Sai Bhasker Raju Avatar asked Jan 31 '18 14:01

Sai Bhasker Raju


1 Answers

You need to use psql. There is no API interface to redshift.

Redshift is based loosely on postgresql however so you can connect to the cluster using the psql command line tool.

https://docs.aws.amazon.com/redshift/latest/mgmt/connecting-from-psql.html

like image 196
Pandelis Avatar answered Sep 21 '22 18:09

Pandelis