Received: from maia.hub.org (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 5BF90632CE0 for ; Sun, 17 Jan 2010 19:00:53 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 06624-06 for ; Sun, 17 Jan 2010 23:00:36 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sd.tpf.co.jp (sd.tpf.co.jp [210.161.239.34]) by mail.postgresql.org (Postfix) with SMTP id DBCC3632281 for ; Sun, 17 Jan 2010 19:00:40 -0400 (AST) Received: (qmail 19496 invoked by uid 512); 17 Jan 2010 23:00:24 -0000 X-Authentication: inoue was authenticated by sd.tpf.co.jp at 17 Jan 2010 23:00:24 -0000 Received: from unknown (HELO ?192.168.24.53?) (121.102.63.108) by sd.tpf.co.jp with SMTP; 17 Jan 2010 23:00:24 -0000 Message-ID: <4B53967D.4020302@tpf.co.jp> Date: Mon, 18 Jan 2010 08:00:13 +0900 From: Hiroshi Inoue User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; ja; rv:1.8.1.23) Gecko/20090812 Thunderbird/2.0.0.23 Mnenhy/0.7.6.0 MIME-Version: 1.0 To: the6campbells CC: pgsql-odbc@postgresql.org Subject: Re: sum(decimal) not returning dp when query run via ODBC on Linux References: <22431f1b1001170803h34084ea1tde619e5dbad112c4@mail.gmail.com> In-Reply-To: <22431f1b1001170803h34084ea1tde619e5dbad112c4@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.409 tagged_above=-10 required=5 tests=AWL=-0.669, BAYES_20=-0.74 X-Spam-Level: X-Archive-Number: 201001/13 X-Sequence-Number: 10176 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