pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Akira Kurosawa <kurosawa-akira@mxc.nes.nec.co.jp>
To: pgsql-bugs@postgresql.org
Cc: iwaasa@mxs.nes.nec.co.jp
Subject: Re: BUG #6096: ECPG set precision of double value to 14 digits
Date: Sat, 16 Jul 2011 21:21:04 +0900
Message-ID: <ACCC43B2D53AD9kurosawa-akira@mxc.nes.nec.co.jp> (raw)

Hi,

I built PostgreSQL 8.4.8 with the following patch,
then executed same program.

This result is same as psql's one.

--------------------------------------------------
testdb=# SELECT * FROM double_table;
        c1
-------------------
    12345678901234
   1234567890.1234
  0.12345678901234
   123456789012345
  1234567890.12345
 0.123456789012345
(6 rows)
--------------------------------------------------


inline patch 1: execute.c (+2/-2 lines) download inline-1.patch*** execute.c.org 2011-04-15 12:17:14.000000000 +0900 --- execute.c 2011-07-16 19:46:05.000000000 +0900 *************** *** 709,720 **** strcpy(mallocedval, "array ["); for (element = 0; element < asize; element++) ! sprintf(mallocedval + strlen(mallocedval), "%.14g,", ((double *) var->value)[element]); strcpy(mallocedval + strlen(mallocedval) - 1, "]"); } else ! sprintf(mallocedval, "%.14g", *((double *) var->value)); *tobeinserted_p = mallocedval; break; --- 709,720 ---- strcpy(mallocedval, "array ["); for (element = 0; element < asize; element++) ! sprintf(mallocedval + strlen(mallocedval), "%.15g,", ((double *) var->value)[element]); strcpy(mallocedval + strlen(mallocedval) - 1, "]"); } else ! sprintf(mallocedval, "%.15g", *((double *) var->value)); *tobeinserted_p = mallocedval; break;

view thread (3+ messages)  latest in thread

Message-ID: <ACCC43B2D53AD9kurosawa-akira@mxc.nes.nec.co.jp>
Permalink:  ../ACCC43B2D53AD9kurosawa-akira@mxc.nes.nec.co.jp/
Also on:    postgresql.org/message-id/ACCC43B2D53AD9kurosawa-akira@mxc.nes.nec.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-bugs@postgresql.org
  Cc: kurosawa-akira@mxc.nes.nec.co.jp, iwaasa@mxs.nes.nec.co.jp
  Subject: Re: BUG #6096: ECPG set precision of double value to 14 digits
  In-Reply-To: <ACCC43B2D53AD9kurosawa-akira@mxc.nes.nec.co.jp>
  References: <ACCC43B2D53AD9kurosawa-akira@mxc.nes.nec.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