Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DB-Library error: DB #: 20009, DB Msg: Unable to connect: Adaptive Server is unavailable or does not exist (hostname), OS #: 0, OS Msg: Success, Level: 9 #368

Open
whalay opened this issue Oct 9, 2024 · 2 comments

Comments

@whalay
Copy link

whalay commented Oct 9, 2024

I created a mssql_server from MSSQL,
I created a foreign table and I want to query from it

postgres=# CREATE FOREIGN TABLE orders(price INT, discount INT) SERVER mssql_server OPTIONS (query 'SELECT PRICE, DISCOUNT FROM apps.odd.orders');
CREATE FOREIGN TABLE

I tried to query the foreign table
select price from orders;

But I got this error: DB-Library error: DB #: 20009, DB Msg: Unable to connect: Adaptive Server is unavailable or does not exist (VSIS-PMSDB), OS #: 0, OS Msg: Success, Level: 9

Operating system

Rhel8

Version of tds_fdw

Version 2.x

Version of PostgreSQL

Postgresql15 
@juliogonzalez
Copy link
Member

There's not much information to provide support and unfortunately the error from TDS is not very descriptive

  • You say tds_fdw is version 2.x... but what version exactly?
  • Did you miss creating the user mapping? It's not on your list.
  • Did you check the MSSQL server is reachable from the machine where PostgreSQL is running? There can be a lot of things failing between your PostgreSQL and MSSQL. I'd assume you did, because of what I see on the error. But if not, check just in case.
  • If MSSQL is reachable, then maybe you need to set the TDS version as specified at https://github.com/tds-fdw/tds_fdw/blob/master/ForeignServerCreation.md or other parameter such as languages... It could be the specifics on your MSSQL server.

@whalay
Copy link
Author

whalay commented Oct 9, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants