Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Zo647-0002l5-Jx for pgsql-jdbc@arkaria.postgresql.org; Mon, 19 Oct 2015 08:45:11 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1Zo647-0007kl-6M for pgsql-jdbc@arkaria.postgresql.org; Mon, 19 Oct 2015 08:45:11 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1Zo63c-0007AI-A5 for pgsql-jdbc@postgresql.org; Mon, 19 Oct 2015 08:44:40 +0000 Received: from mail.heuthes.pl ([213.76.141.132] helo=poczta.heuthes.pl) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1Zo63Z-0007CX-R1 for pgsql-jdbc@postgresql.org; Mon, 19 Oct 2015 08:44:39 +0000 Subject: Re: Change of format of returned flat value after prepareThreshold References: <561F9990.10702@heuthes.pl> <56208B5C.9090803@heuthes.pl> Cc: List From: =?UTF-8?Q?Micha=c5=82_Niklas?= X-Enigmail-Draft-Status: N1010 Message-ID: <5624AD73.2070007@heuthes.pl> Date: Mon, 19 Oct 2015 10:44:35 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/mixed; boundary="------------090501000403050901060505" X-Pg-Spam-Score: -0.9 (/) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-jdbc Precedence: bulk Sender: pgsql-jdbc-owner@postgresql.org This is a multi-part message in MIME format. --------------090501000403050901060505 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit W dniu 16.10.2015 o 12:15, Vladimir Sitnikov pisze: > [...] >> If I set prepareThreshold=5 then I get float in normal notation >> up to 5th try, and then from 6th try I get this value in >> scientific notation. > > Well, that is thanks to usage of server-prepared statement. In that > mode, pgjdbc can use binary format of data transfer. It does use > binary mode for types it knows as it is more efficient to transfer > and parse. OK, but I think string representation of such float should not change during program life. I tested JDBC driver with much simpler query: SELECT 1445006113904::float8 so there is known, constant number. Up to prepareThreshold I got: 1445006113904, then I got: 1.445006113904E12 I think it is bug because I expect to have the same string representation of such number regardless of prepareThreshold. It may be normal or scientific notation, but SELECT for known, constant parameters should give the known output. Now output is inconsistent. In attachment there is Jython code that on my machine shows: jdbc:postgresql://test-baza.heuthesd:5494/isof_test?stringtype=unspecified&prepareThreshold=2 -------------- PostgreSQL 9.4.5 on x86_64-unknown-linux-gnu, compiled by gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-16), 64-bit JDBC driver version is 'PostgreSQL 9.4 JDBC4.2 (build 1204)'; major: 9; minor: 4 testing with query: SELECT 1445006113904::float8 --- 1 --- column type: float8 (8); java: java.lang.Double; precision: 17; scale: 17 getString(): 1445006113904 --- 2 --- column type: float8 (8); java: java.lang.Double; precision: 17; scale: 17 getString(): 1445006113904 --- 3 --- column type: float8 (8); java: java.lang.Double; precision: 17; scale: 17 getString(): 1.445006113904E12 STRING FORMAT CHANGED!!! -- Regards, MichaƂ Niklas --------------090501000403050901060505 Content-Type: application/x-zip-compressed; name="jdbc_pg_float_time.py.zip" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="jdbc_pg_float_time.py.zip" UEsDBBQAAAAIALhTU0eCPEclkQMAAJEHAAAVABwAamRiY19wZ19mbG9hdF90 aW1lLnB5VVQJAAP8qSRW/6kkVnV4CwABBOgDAAAE6AMAAIVVbW/bNhD+LP2K s1tX0mbLL3WGREEwdE7WdViyrQ72YTAg0CJtM5MolaTiuL9+PFJS7Dbd/MEm eXfP3T18fHzVG9dKjtdcjJl4hIeD3pXCfwWj70aQlZSL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ycSRe1UJVZvptOKNvGnXc7wzSrszp1SwYQtBin6wj /19QSwECHgMUAAAACAC4U1NHgjxHJZEDAACRBwAAFQAYAAAAAAABAAAA/YEA AAAAamRiY19wZ19mbG9hdF90aW1lLnB5VVQFAAP8qSRWdXgLAAEE6AMAAATo AwAAUEsFBgAAAAABAAEAWwAAAOADAAAAAA== --------------090501000403050901060505 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-jdbc --------------090501000403050901060505--