Skip site navigation (1) Skip section navigation (2)

a precision problem of the SQL_C_DOUBLE value in the PsqlODBC

From: "Hiroki Kataoka" <kataoka(at)interwiz(dot)koganei(dot)tokyo(dot)jp>
To: "Pgsql-Interfaces" <pgsql-interfaces(at)postgreSQL(dot)org>
Subject: a precision problem of the SQL_C_DOUBLE value in the PsqlODBC
Date: 1999-12-21 07:16:19
Message-ID: NDBBIKCHILNJOAAPDPKMEECOCAAA.kataoka@interwiz.koganei.tokyo.jp (view raw or flat)
Thread:
Lists: pgsql-interfaces
Hi all.

I have found a precision problem of the SQL_C_DOUBLE value in the PsqlODBC.

When the PsqlODBC send a SQL_C_DOUBLE value from the ODBC client application
to PostgreSQL server, the precision is missing.

=====
Hiroki Kataoka




Following is a patch to fix this problem.

*** src.v06-40-0007/convert.c	Fri Apr  9 18:47:40 1999
--- src.v06-40-0007.test/./convert.c	Thu Dec 16 11:51:00 1999
***************
*** 710,721 ****
  			break;

  		case SQL_C_DOUBLE:
! 			sprintf(param_string, "%f",
  				 *((SDOUBLE *) buffer));
  			break;

  		case SQL_C_FLOAT:
! 			sprintf(param_string, "%f",
  				 *((SFLOAT *) buffer));
  			break;

--- 710,721 ----
  			break;

  		case SQL_C_DOUBLE:
! 			sprintf(param_string, "%.16g",
  				 *((SDOUBLE *) buffer));
  			break;

  		case SQL_C_FLOAT:
! 			sprintf(param_string, "%.7g",
  				 *((SFLOAT *) buffer));
  			break;


pgsql-interfaces by date

Next:From: Hiroki KataokaDate: 1999-12-21 07:45:10
Subject: RE: ODBC and RDO
Previous:From: Robert HiltibidalDate: 1999-12-20 19:47:03
Subject: ODBC and RDO

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group