Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fzN4O-0005i4-Lc for pgsql-general@arkaria.postgresql.org; Mon, 10 Sep 2018 14:21:40 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fzN4N-0004jk-1V for pgsql-general@arkaria.postgresql.org; Mon, 10 Sep 2018 14:21:39 +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.89) (envelope-from ) id 1fzN4M-0004jd-Pe for pgsql-general@lists.postgresql.org; Mon, 10 Sep 2018 14:21:38 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fzN4D-0000dJ-RE for pgsql-general@lists.postgresql.org; Mon, 10 Sep 2018 14:21:38 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id E2E5C21908; Mon, 10 Sep 2018 10:21:26 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Mon, 10 Sep 2018 10:21:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; bh=P+Q6RWMMFKGBX0OQQEYNB/02ztM2J fFMQuND4w0Wg+c=; b=vtw9/K1Jd//H91y/r77AhhwRLifBELKY4rXbuzc8amvOl 4tf3T0UuhqWoILbk45+b9Sc5QbCcxmI35aImJJ1dzu8SIypVbDOVUQufrOOVg5Zw hs4sa9QJWJp7/mSo/DDI1JijprP7+I82RzhkGv4z++KQxQ/pPP2l/f31bXhEhNNx xDion/+6iE0p4JdIo4wwsN+owmOBUCg9bnmKCa0zG1S2FjU8H/omxaM0zE1gktZr IBZndKcDPo+Q/4znCg3esvv8m74UA20Kpufc1D/2+0BeqO0wOrb2fSReBSX/2Cxi LJTyDnAoPxP+qFbZq9In6O2vRM3bi/HUweVJfMwag== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=P+Q6RW MMFKGBX0OQQEYNB/02ztM2JfFMQuND4w0Wg+c=; b=pUDFzcVtRnzZdcdBsIPtrp TcnoCxN+ripMQUC3iMPEEUB44IlXCXa5RA3OQOZTAvciGekp7pi7QbjPQK/9Z/O6 5CL1FUWXGqPffnu9xFa7WnIB4uRvdJ342Lp0TMtPLzyGsYLrptNJyU7FDRCXEDGA Lntv+/3ytzy8cJS6x0+kchD6KcbGai/WlBOZxc4Dl/buDlIliMLjlLmlJmKV8/Vq g909XOOykb/wrS+7UAHm9qwZ3xOeQ4QB2ne0e95qZTiaX21FzkwGo7A7vb2qMPra 1OkhbYNhmms3eWI9G5OvpMX3CnnVInzk6UOLIl5cD3D1uCkQqHK0M71XTe3XfymQ == X-ME-Proxy: X-ME-Sender: Received: from [192.168.1.3] (unknown [71.212.134.3]) by mail.messagingengine.com (Postfix) with ESMTPA id ED074E4118; Mon, 10 Sep 2018 10:21:25 -0400 (EDT) Subject: Re: PG8.3->10 migration data differences To: Csaba Ragasits , pgsql-general@lists.postgresql.org References: <20180910100040.wzglexkarz57w3ts@hjp.at> From: Adrian Klaver Message-ID: <07333286-2480-8750-c73d-d82e061b2bca@aklaver.com> Date: Mon, 10 Sep 2018 07:21:25 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 9/10/18 6:43 AM, Csaba Ragasits wrote: > I think I found the solution. > > When I set this parameter on the pg10 client connection, the pg10 REAL > value format same as the pg83 value: > > SET extra_float_digits = 0; > > Interesting, because the default value is 0 in the postgresql.conf: > #extra_float_digits = 0                 # min -15, max 3 > > Do you have any ideas how can I format the miliseconds too? select version(); version ------------------------------------------------------------------------------------ PostgreSQL 10.5 on x86_64-pc-linux-gnu, compiled by gcc (SUSE Linux) 4.8.5, 64-bit test=# select '09/10/18 07:10:25.100'::timestamp; timestamp ----------------------- 2018-09-10 07:10:25.1 (1 row) test=# select '09/10/18 07:10:25.111'::timestamp; timestamp ------------------------- 2018-09-10 07:10:25.111 Milliseconds will display if they are significant. If you want to format the output: test=# select to_char('09/10/18 07:10:25.100'::timestamp, 'MM/DD/YY HH:MI:SS.MS'); to_char ----------------------- 09/10/18 07:10:25.100 (1 row) > > Thx, > Csaba > > 2018-09-10 12:00 GMT+02:00 Peter J. Holzer >: > > On 2018-09-10 11:57:42 +0300, Achilleas Mantzios wrote: > > On 10/09/2018 11:22, Csaba Ragasits wrote: > >     Hello, > > > >     We would like to migrate our old databases to new postgres server, > >     with the simple backup-restore process. The process run fine > >     without errors but when we're  checking the source and the > >     migrated datas as field level, we found the following differences: > [...] > > > >     Field type: REAL > >     pg93: 2.2 > >     pg10: 2.20000005 > > > > > > Those have to do with rounding. Precision for real is 6 decimal > > digits. Your difference is on the 8-th digit. > > Nitpick: Precision is 24 binary digits which is *about* 6 decimal > digits. The number which is actually stored (on both pg93 and pg10) is > actually 2.2000000476837158203125 (1.00011001100110011001101 * 2^1 in > binary). Apparently Pg9.3 rounds this to "2.2" on output while Pg10 > prints the more precise (but still not exact) "2.20000005". > > (I would argue that the Pg9.3 output is better, since it represents the > same value in fewer digits, but always printing the minimum number of > digits necessary is surprisingly difficult.) > >         hp > > -- >    _  | Peter J. Holzer    | we build much bigger, better disasters now > |_|_) |                    | because we have much more sophisticated > | |   | hjp@hjp.at          | management tools. > __/   | http://www.hjp.at/ | -- Ross Anderson > > -- Adrian Klaver adrian.klaver@aklaver.com