Skip to navigation
How to access a How to access a Mssql server with a Postgres server server with postgres server
07.01.25
I could use the Postgres extension tds_fdw ## Install tds_fdw ``` export TDS_FDW_VERSION="2.0.4" sudo apt-get install wget postgresql-server-dev-17 wget https://github.com/tds-fdw/tds_fdw/archive/v${TDS_FDW_VERSION}.tar.gz tar -xvzf v${TDS_FDW_VERSION}.tar.gz cd tds_fdw-${TDS_FDW_VERSION}/ make USE_PGXS=1 sudo make USE_PGXS=1 install ``` [!NOTE] You may need more dependencies libraries, but all exists for debian12 at the moment. ## Example Usage for one Postgres user ``` create extension tds_fdw; CREATE SERVER ms FOREIGN DATA WRAPPER tds_fdw OPTIONS(servername '192.168.1.1',database 'bar',port '1433'); CREATE USER MAPPING FOR postgres SERVER ms OPTIONS (username 'foo', password 'PASSWORD'); CREATE USER MAPPING FOR salamander SERVER ms OPTIONS (username 'foo', password 'PASSWORD'); CREATE FOREIGN TABLE ms_pricelist(id int ,name nchar(50)) SERVER ms OPTIONS (query 'SELECT id,name FROM dbo.pricelist'); select * from ms_pricelist; ```
https://github.com/tds-fdw/tds_fdw/blob/master/InstallDebian.md
Reply
Anonymous
Information Epoch 1741795902
Small is beautiful.
Home
Notebook
Contact us