0

I need to insert data into a table from one redshift cluster to another. I have it working by injecting one of my postgres rds in the middle.

Use postgres_fdw on the rds to point to the table i want to insert on in Cluser B

Use federated queries on Cluster A to write to that table in the RDS

Is there an easier way to do this without needing the RDS in the middle? Synchronous though, I don't want to unload to a s3 bucket with a lambda rule cause that lambda rule would run async. When my query on Cluster A finishes I want the data to be available in the data share from Cluster B.

user433342
  • 859
  • 1
  • 7
  • 26
  • If you have a data share already set up, you should be able to make a table or do an insert from a read-only query. That should functionally be the same as an insert. insert into table(a, b) select a, b from datashare.table – dfundako May 03 '23 at 15:13
  • @dfundako I want to insert a table into the cluster that's sharing the data, from the consumer cluster... I just made another data share the other way around and switched to a unioned view – user433342 May 03 '23 at 17:47

1 Answers1

-1

Redshift data sharing is made for this use case. See the Redshift overview for more details.

MP24
  • 3,110
  • 21
  • 23