6

I need to be able to query a SQL Server database from within Postgresql. The Postgres instance is running locally and the SQL server set up as an ODBC data source. How do I add this as a linked server? Is there a better approach?

Thanks

1 Answer 1

4

The two available options are:

  • DBI-Link; or
  • The ODBC-FDW (SQL/MED foreign data wrapper)

DBI-link is more mature, and will work on Windows. The ODBC FDW is likely to be better once it's properly finished, but at this point it isn't, and AFAIK it is not available on Windows.

See:

Sign up to request clarification or add additional context in comments.

3 Comments

Do you know if the ODBC FDW is properly finished now Craig?
@JackDouglas Unless someone else has picked it up it is moribund. The last commit is 2 years ago. github.com/ZhengYang/odbc_fdw . The fork graph shows a few people working on it, including Andrew Dunstain (github.com/ZhengYang/odbc_fdw/network), but no sustained effort.
Thanks, I've been using dbi-link for years and I think I will stick with it for now :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.