Postgresql – How to install tds_fdw on AWS RDS for SQL Server

postgresql

I am using AWS RDS Posgres DB. I would like to connect Postgres to my SQL Server 2019, so that I can have sql server tables available in foreign table drop down of postgres for querying. As I know, tds_fdw data wrapper is required. When I tried to create tds_fdw extension through super user account in AWS RDS, I got the following error:

ERROR: Extension "tds_fdw" is not supported by Amazon RDS
DETAIL: Installing the extension "tds_fdw" failed, because it is not on the list of extensions supported by Amazon RDS.
HINT: Amazon RDS allows users with rds_superuser role to install supported extensions. See: SHOW rds.extensions;
SQL state: 22023

Is there any way to install tds_fdw on AWS RDS? If not then, what other ways I can use to connect AWS RDS Postgres to my SQL Server?

Best Answer

If RDS doesn't allow it, then you can't do it on RDS. The straightforward solution is not to use RDS if it doesn't support the features you need.

But RDS does allow postgres_fdw. So the convoluted solution is to run your own postgres server (perhaps running it on an EC2 instance) which does supports tds_fdw, and then connect to that from RDS and chain the foreign tables.