I have a Postgres DB hosted on AWS Aurora from which I need to retrieve data and insert it into Redshift.
My current approach is as follows:
- Create an Aurora DB connection using Psycopg2.
- With Aurora connection created above, query the Aurora DB table and export the resultset as a CSV file to S3 using
OUTFILE - From S3, Redshift connection using Psycopg2.
I'm trying to optimize this by removing the S3 service and connecting Aurora to Redshift directly.
Here's what I want to do for which I couldn't find resources:
Query the Aurora table - table1 and directly export the result set into the Redshift table - table1.
I'm not even sure if this is possible with the current system. Any thoughts?