BUG #3251: selection of numeric columns from MS SQL Server return wron values

Lists: pgsql-bugs
From: "CarlosCastaneda" <kjatwork(at)gmx(dot)net>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #3251: selection of numeric columns from MS SQL Server return wron values
Date: 2007-04-24 13:04:54
Message-ID: 200704241304.l3OD4sSC044226@wwwmaster.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs


The following bug has been logged online:

Bug reference: 3251
Logged by: CarlosCastaneda
Email address: kjatwork(at)gmx(dot)net
PostgreSQL version: 8.2.4
Operating system: Windows XP
Description: selection of numeric columns from MS SQL Server return
wron values
Details:

I used to run queries against PostreSQL from MS SQL Server via linked server
over OLEDB Provider ODBC.
The interface used to work up to version 8.2.3. As of lastest update (8.2.4)
selecting data on numeric(12,2) colums always return 0. Converting the
numeric columns to real succeeds.
Example:
select * from OPENQUERY([Postgres], 'select numericcolomn from table')
returns 0.
select * from OPENQUERY([Postgres], 'select numericcolomn::real from table')
returns the correct values.

But I want to insert data into PostgreSQL via MS SQL Server.
insert into select * from OPENQUERY([Postgres], 'select numericcolomn from
table where 1=0')
select * from SQLServertable

Running the statement above only inserts 0 values.

insert into select * from OPENQUERY([Postgres], 'select numericcolomn::real
as numericcolumn from table where 1=0') select * from SQLServertable
doesn't work either.

It seems, as if there has been a major change in pgODBC provider.

The ODBC Provider version is 08.02.03.00