pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Hiroshi Inoue <inoue@tpf.co.jp>
To: the6campbells <the6campbells@gmail.com>
Cc: pgsql-odbc@postgresql.org
Subject: Re: sum(decimal) not returning dp when query run via ODBC on Linux
Date: Mon, 18 Jan 2010 08:00:13 +0900
Message-ID: <4B53967D.4020302@tpf.co.jp> (raw)
In-Reply-To: <22431f1b1001170803h34084ea1tde619e5dbad112c4@mail.gmail.com>
References: <22431f1b1001170803h34084ea1tde619e5dbad112c4@mail.gmail.com>

the6campbells wrote:
> query works fine via ODBC on Windows and via the SQL Gui on both Linux 
> and Windows against the same instance of Postgres 8.4 (running on Windows).
> 
> any suggestions?

Which version of psqlodbc driver are you using?
The recently released version (8.4.0200) will fix the problem.

regards,
Hiroshi Inoue

> postgres on linux
> "PostgreSQL 8.4.2 on i686-pc-linux-gnu, compiled by GCC gcc (GCC) 3.4.6 
> 20060404 (Red Hat 3.4.6-10), 32-bit"
> postgres on windows
> "PostgreSQL 8.4.1, compiled by Visual C++ build 1400, 32-bit"
> 
> 
> CREATE TABLE tdec
> (
>   rnum integer NOT NULL,
>   cdec numeric(7,2)
> )
> 
> -1.00
> 0.00
> 1.00
> 0.10
> 10.00
> 
> using isql or an application using the ODBC driver
> 
> SQL> select sum (cdec) from tdec
> +-------------+
> | sum         |
> +-------------+
> | 10          |
> +-------------+
> SQLRowCount returns 1
> 1 rows fetched
> SQL> select * from tdec
> +------------+----------+
> | rnum       | cdec     |
> +------------+----------+
> | 0          |          |
> | 1          | -1       |
> | 2          | 0        |
> | 3          | 1        |
> | 4          | 0        |
> | 5          | 10       |
> +------------+----------+
> 
> Doing a simple prepare and describe col
> 
>   Out:
>     Column Name: sum
>     *Name Length Ptr: 3
>     *Data Type Ptr: SQL_NUMERIC (2)
>     *Column Size Ptr: 10
>     *Decimal Digits Ptr: 5
>     *Nullable Ptr: 1
> 
> odbc.ini
> 
> [PG84]
> Description             = PostgreSQL
> Driver          = psqlODBC
> Database                = test
> Servername              = remotebox
> Username                = test
> Password                = test123$
> Port            = 5432
> Protocol                = 7.4
> ReadOnly                = No
> RowVersioning           = No
> ShowSystemTables        = No
> ShowOidColumn           = No
> FakeOidIndex            = No



view thread (2+ messages)

Message-ID: <4B53967D.4020302@tpf.co.jp>
Permalink:  ../4B53967D.4020302@tpf.co.jp/
Also on:    postgresql.org/message-id/4B53967D.4020302@tpf.co.jp

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-odbc@postgresql.org
  Cc: inoue@tpf.co.jp, the6campbells@gmail.com
  Subject: Re: sum(decimal) not returning dp when query run via ODBC on Linux
  In-Reply-To: <4B53967D.4020302@tpf.co.jp>
  References: <22431f1b1001170803h34084ea1tde619e5dbad112c4@mail.gmail.com> <4B53967D.4020302@tpf.co.jp>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox