Error : SQL state: 58000

From: Soumya Ghosh <soumya_online(at)outlook(dot)com>
To: "pgsql-hackers(at)lists(dot)postgresql(dot)org" <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Error : SQL state: 58000
Date: 2023-10-05 13:18:01
Message-ID: CH3PR14MB6794E37F2BC2F1A15354F07290CAA@CH3PR14MB6794.namprd14.prod.outlook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Dear Concern,

We are trying to connect SQL Server from PostgreSQL through odbc_fdw extension.
We are using PostgreSQL version 15 and enclosed installed extension is attached. First, we create the foreign server.
Then we map the postgres user and created foreign table as per the requirement by following code:

CREATE EXTENSION odbc_fdw;

CREATE SERVER sql_server_odbc
FOREIGN DATA WRAPPER odbc_fdw
OPTIONS (dsn 'SqlConnect');

CREATE FOREIGN TABLE USER_LOCATION_PERMISSION_ODBC (
id bigint NOT NULL,
locationsfilter_id bigint NOT NULL,
user_id bigint NOT NULL
)
SERVER sql_server_odbc
OPTIONS (schema_name 'dbo', table_name 'USER_LOCATION_PERMISSION');

CREATE USER MAPPING FOR postgres
SERVER sql_server_odbc

But while executing below statement,
SELECT * FROM USER_LOCATION_PERMISSION_ODBC

We will get the following error:
ERROR: Connecting to driver SQL state: 58000

Please suggest me why this error was occurred.

Regards,
Soumya Ghosh

Attachment Content-Type Size
fdw_win64_15_bin.7z application/octet-stream 21.5 KB

Browse pgsql-hackers by date

  From Date Subject
Next Message Jean-Christophe Arnu 2023-10-05 13:36:55 Re: FDW pushdown of non-collated functions
Previous Message Bharath Rupireddy 2023-10-05 13:13:30 Re: [PoC] pg_upgrade: allow to upgrade publisher node