Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does Amazon Redshift support extension dblink?

CREATE EXTENSION dblink;

I tried to create an extension dblink in AWS, but I receive this error.

ERROR: syntax error at or near "EXTENSION" LINE 1: create extension dblink;

like image 281
Reece Mak Avatar asked Dec 19 '22 05:12

Reece Mak


2 Answers

Yes and No.

Amazon Redshift itself does not provide dblink. However, you can install dblink on a different PostgreSQL server and use it to connect to Amazon Redshift.

See: JOIN Amazon Redshift AND Amazon RDS PostgreSQL WITH dblink

like image 71
John Rotenstein Avatar answered Jan 13 '23 13:01

John Rotenstein


The answer is "Yes", but you have to use Amazon RDS as a ‘cache’ by leveraging the Dblink feature of RDS. This allows us to make any Amazon Redshift table available as a relation in RDS, without the need to explicitly copy that data over. Dblink handles moving the data at the block level.

We've used the approach described in the link that John has provided above. We did a detailed write up of how we did it in a blog post "Have Your Postgres Cake with Amazon Redshift and eat it, too."

https://www.intermix.io/blog/using-amazon-redshift-with-amazon-rds/

like image 38
Lars Kamp Avatar answered Jan 13 '23 11:01

Lars Kamp