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 1faHcs-0008GC-ES for pgsql-bugs@arkaria.postgresql.org; Tue, 03 Jul 2018 09:29:34 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1faHcq-0002FR-JF for pgsql-bugs@arkaria.postgresql.org; Tue, 03 Jul 2018 09:29:32 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1faHVU-0007bl-AV for pgsql-bugs@lists.postgresql.org; Tue, 03 Jul 2018 09:21:56 +0000 Received: from mail-lj1-x244.google.com ([2a00:1450:4864:20::244]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1faHVQ-0003uN-SF for pgsql-bugs@lists.postgresql.org; Tue, 03 Jul 2018 09:21:54 +0000 Received: by mail-lj1-x244.google.com with SMTP id a17-v6so959384ljd.8 for ; Tue, 03 Jul 2018 02:21:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ensilo-com.20150623.gappssmtp.com; s=20150623; h=from:references:in-reply-to:mime-version:thread-index:date :message-id:subject:to; bh=FA9UrlqztyKDt1VbEQSBqxAWyr+1Js2s9K8XRg+mMTc=; b=WlGW5jqyPybl4wqRoBeprSZOE1KVm8JFqVadFTTkPDzz4KKld9wJxS4Kywinv/rIor RNHh8Ak+xEBw+s40a55/vQq+4NMJ64ts+flnMwZ16lTygEubYiCt0cR67IOrfNbOoyQp 7dOiNRmyTkZhcqkEc8amJXIuwGioY5Xeuv1yNa967jROwrOF5Kg+0gZse2iOpmMJfroR j/3sfc4mu7gOIL9NBR4LXYnSb3A8p89nJ+e6krjdyhE0MnBogyxcYxF2oVaztygWPhPU xnFDOwTiLt9ripZ8j+AjVqgJvqO0gtghRF7j3VvvBqRO6YmypfCTIM+Aubh8Le+8jUe4 xiSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:references:in-reply-to:mime-version :thread-index:date:message-id:subject:to; bh=FA9UrlqztyKDt1VbEQSBqxAWyr+1Js2s9K8XRg+mMTc=; b=NaXyEBwvc+Y8aCwARmtaK/4zZ34l1NZVuBy0GWB2jTMPQWUSNqVwYGdrpFbU5GeUvQ DPwjy05vv+5ovb8Bz2Oly9QAQ4pJEPF0SuM2C1ZkAIbGGz4dSR4W7IHrjpSebnj9BiUC G4iEFZYibjRFivDqRr2KEaG68Uc25K4PKSyTf3bu06goPiAZf2Id81iAnBoxNFK4qMTl sIqnaonLu7v/gLX1uqbMVLjEXuQcluN5bdgifIlBXYG9/OXl0pd65tDn07K4EYxGqTNd btQ7jJfVGB98EWfkn6zPas8ksEexdfNTVxnxhlqhjQZh+4exQpR5Mb/QsPpcqlX7e+lV gdPA== X-Gm-Message-State: APt69E33TCbI6fdJGnUW/YTNiTEfANlpM7cRNShtx3V1TgQ0rNneWMfU xifmdOXpes1871MtjwFbJWoJd3RpeZtMyMPAF+lEwQ== X-Google-Smtp-Source: AAOMgpe+YFY+YGb3yksn9QeNNlyrAEew9wS1hhG3rKU80xDRv3ho+MKeLu1gtsku6PrYWHsJcxBPMLkHgoaqZyFIM28= X-Received: by 2002:a2e:7014:: with SMTP id l20-v6mr3085119ljc.141.1530609711292; Tue, 03 Jul 2018 02:21:51 -0700 (PDT) From: Uri Parush References: <153060922319.13258.1825649892372139910@wrigleys.postgresql.org> In-Reply-To: MIME-Version: 1.0 X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQIxEAivwyepf3xl7KyQAo44O+CtSAJlyUp+o7AP8/A= Date: Tue, 3 Jul 2018 12:21:48 +0300 Message-ID: Subject: RE: BUG #15260: When saving json object to a json column bigInteger value is saved wrong To: Magnus Hagander , pgsql-bugs@lists.postgresql.org Content-Type: multipart/alternative; boundary="00000000000021bda0057014d859" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --00000000000021bda0057014d859 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable I=E2=80=99m using pgAdmin. I will check it without it now *From:* Magnus Hagander [mailto:magnus@hagander.net] *Sent:* Tuesday, July 3, 2018 12:18 PM *To:* urip@ensilo.com; pgsql-bugs@lists.postgresql.org *Subject:* Re: BUG #15260: When saving json object to a json column bigInteger value is saved wrong On Tue, Jul 3, 2018 at 11:13 AM, PG Bug reporting form < noreply@postgresql.org> wrote: The following bug has been logged on the website: Bug reference: 15260 Logged by: Uri Parush Email address: urip@ensilo.com PostgreSQL version: 9.6.0 Operating system: windows 10 Description: Hi, I think I found a bug in PostgreSQL json column type. I created the next table: CREATE TABLE public."Dummy" ( json json ) And insert the next data: INSERT INTO public."Dummy"( json) VALUES ( '{ "ID": 9059650307334996772}' ); The data that was saved was incorrect: {"ID":9059650307334997000} Looks like PostgreSQL round the number in the insertion. Doesn't work that way for me -- mine returns the original number. In particular, the json datatype doesn't do any parsing at all, so it "cannot happen". jsonb does parsing, but that one also doesn't round it off. Are you doing this from psql or some other frontend tool? My guess is the frontend tool is somehow messing with the data for you. If you didn't already do it in psql, please confirm if you can reproduce it from there. --=20 Magnus Hagander Me: https://www.hagander.net/ Work: https://www.redpill-linpro.com/ --00000000000021bda0057014d859 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

I=E2=80=99m using pgAdmin.

I will check it without it now

=C2=A0

From: Magnus Hagander [mailto= :magnus@hagander.net]
Sen= t: Tuesday, July 3, 2018 12:18 PM
To: urip@ensilo.com; pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #15= 260: When saving json object to a json column bigInteger value is saved wro= ng

=C2=A0

=C2= =A0

On Tue, Jul 3, 2018 at 11:13 AM, PG Bug = reporting form <noreply@postgresql.org> wrote:

The following bug has been log= ged on the website:

Bug reference:=C2=A0 =C2=A0 =C2=A0 15260
Logg= ed by:=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Uri Parush
Email address:=C2=A0= =C2=A0 =C2=A0 urip@ensilo.com
Po= stgreSQL version: 9.6.0
Operating system:=C2=A0 =C2=A0windows 10
Desc= ription:=C2=A0 =C2=A0 =C2=A0 =C2=A0

Hi, I think I found a bug in Po= stgreSQL json column type.
I created the next table:
CREATE TABLE pub= lic."Dummy"
(
=C2=A0 =C2=A0json json
)

And insert= the next data:
INSERT INTO public."Dummy"(
=C2=A0 =C2=A0 j= son)
=C2=A0 =C2=A0 VALUES (
'{ "ID": 905965030733499677= 2}'
);


The data that was saved was incorrect:
{"I= D":9059650307334997000}

Looks like PostgreSQL round the number = in the insertion.

=C2=A0

Doesn't work that way for me -- mine ret= urns the original number. In particular, the json datatype doesn't do a= ny parsing at all, so it "cannot happen". jsonb does parsing, but= that one also doesn't round it off.


Are you doing this from psql or some other frontend tool? My guess = is the frontend tool is somehow messing with the data for you. If you didn&= #39;t already do it in psql, please confirm if you can reproduce it from th= ere.

=C2=A0

--

=C2=A0Magnus= Hagander
=C2=A0Me: https://www.hagander.net/
=C2=A0Work: https://www.redpill-linpro.com/

--00000000000021bda0057014d859--