Closed fosstrack closed 5 years ago
I am not familiar with Redshift and I need to take a look. Since your DB is PostgreSQL, have you tried?
select count(*) from mySchema.myTable;
Thanks. Yes. That will work. I was wondering if there is any way to SET variables applicable to the query or to the session before running it to avoid inserting schema.myTable.
I will try handle your use case in a more generic way: if there are multiple statements, each of them will be executed in order in the same session and the last statement will return query result.
Was able to connect to AWS Redshift using a Postgres compatible JDBC driver (https://docs.aws.amazon.com/redshift/latest/mgmt/configure-jdbc-connection.html)
However, my data is partitioned into multiple schemas. Need to select the schema before running the query. e.g.
The error I get is:
Internal Server Error: PreparedStatementCallback; bad SQL grammar [set search_path to xyzz; select * from....
Please suggest a way to do this either while creating the query or when setting up the data source (I can then create multiple datasources - one database per schema.)