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

Problem importing foreign MSSQL schema #22

Open
grouchobear opened this issue May 9, 2023 · 4 comments
Open

Problem importing foreign MSSQL schema #22

grouchobear opened this issue May 9, 2023 · 4 comments

Comments

@grouchobear
Copy link

We're attempting to connect to an MSSQL server and are receiving an error when importing the dbo schema. The error is:
ERROR: remote server returned an error

SQL state: XX000

Not sure what this indicates and any insights are appreciated.

Steps used creating the FDW:
CREATE EXTENSION IF NOT EXISTS jdbc_fdw SCHEMA public VERSION "1.2";

/* mssql-jdbc-12.2.0.jre11.jar is located in /usr/bin */
CREATE SERVER lyons_mssql FOREIGN DATA WRAPPER jdbc_fdw OPTIONS(
drivername 'com.microsoft.sqlserver.jdbc.SQLServerDriver',
url 'jdbc:sqlserver://;serverName=sqlcluster;databaseName=lmdw',
querytimeout '30',
jarfile '/usr/bin/mssql-jdbc-12.2.0.jre11.jar',
maxheapsize '600'
);

CREATE USER MAPPING FOR CURRENT_USER SERVER lyons_mssql OPTIONS(username 'readeruser',password '*********');

CREATE SCHEMA IF NOT EXISTS lyons_mssql_dbo AUTHORIZATION postgres;

IMPORT FOREIGN SCHEMA dbo LIMIT TO (BATCH) FROM SERVER lyons_mssql INTO lyons_mssql_dbo;

@Kenchir
Copy link

Kenchir commented May 11, 2023

I am not sure. But its said on docs, import schema works only on GridDB.
You can use this PR which fixes debug mode display on logs for more understanding of the error you are facing.

@JulmeTran
Copy link

Currently, we do not support JDBC FDW with SQL Server.
We have not tested on SQL Server and only support import foreign schema on GridDB.
Therefore, we can not provide any information about this problem.

@m0rt
Copy link

m0rt commented May 29, 2024

Hello.

I currently have the same problem when connecting to SyBase ASE, is it possible to activate debug ?

@ShahriarKh
Copy link

ShahriarKh commented Jan 22, 2025

For anyone facing the same issue, you can check the logs on sql server side. In SSMS, from Object Explorer, open XEvent Profiler and try to run the query from postgres again. You will see live logs in SSMS and that can help you debug.
For me, it was a connection issue and I had to use jdbc:// ... ;trustServerCertificate=true;encrypt=false; to connect to my local instance.

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

5 participants