Windows ODBC Driver configuration help - Mailing list pgsql-odbc

From Andrew Kagan
Subject Windows ODBC Driver configuration help
Date
Msg-id MN2PR13MB359989E039A2C7BEBC3EE96BB6710@MN2PR13MB3599.namprd13.prod.outlook.com
Whole thread Raw
List pgsql-odbc

[Redirecting from pgsql-novice]

 

Hi All: First time poster and PostgreSQL noob…trying to set up a linked server in SSMS (SQL Server 15.0.2000.5) using 64-bit PostgreSQL Unicode(x64) driver. The PostgreSQL server is 10.5. My access to the server is readonly.

 

I configured the datasource and tested successfully, and am able to create the linked server in SSMS and drill down to the tables, but if I try a simple query, I receive the error:

 

Msg 7356, Level 16, State 1, Line 2

The OLE DB provider "MSDASQL" for linked server "[DSNname]" supplied inconsistent metadata for a column. The column "[colname]" (compile-time ordinal 3) of object ""[table]"."public"."[column]"" was reported to have a "DBCOLUMNFLAGS_ISLONG" of 128 at compile time and 0 at run time.

 

In pgAdmin, the datatype of the column referenced in the error is "citext". The field is limited to 5 characters by the app connected to the dB, so there isn’t any really long text in it.

 

On the driver config first page, I have “text as LongVarChar” checked and the other two boxes unchecked. I have “unknown sizes” set to “maximum”.

 

I tried casting the field in the error message as “nvarchar(512)” but it didn’t help.

 

Not sure if it’s a setting in the ODBC driver, but the few citations on Google pointed to that being the source of the error (and the settings I’m using above is supposed to fix it).

 

TIA!

 

pgsql-odbc by date:

Previous
From: "Inoue, Hiroshi"
Date:
Subject: Re: Regression tests fail with PG12
Next
From: "Kubilay Kaan"
Date:
Subject: Getting Recordset through returning refcursor