pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
BUG #15260: When saving json object to a json column bigInteger value is saved wrong
4+ messages / 4 participants
[nested] [flat]

* BUG #15260: When saving json object to a json column bigInteger value is saved wrong
@ 2018-07-03 09:13 PG Bug reporting form <noreply@postgresql.org>
  2018-07-03 09:17 ` Re: BUG #15260: When saving json object to a json column bigInteger value is saved wrong Magnus Hagander <magnus@hagander.net>
  0 siblings, 1 reply; 4+ messages in thread

From: PG Bug reporting form @ 2018-07-03 09:13 UTC (permalink / raw)
  To: pgsql-bugs@lists.postgresql.org; +Cc: urip@ensilo.com

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.



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: BUG #15260: When saving json object to a json column bigInteger value is saved wrong
  2018-07-03 09:13 BUG #15260: When saving json object to a json column bigInteger value is saved wrong PG Bug reporting form <noreply@postgresql.org>
@ 2018-07-03 09:17 ` Magnus Hagander <magnus@hagander.net>
  2018-07-03 09:21   ` RE: BUG #15260: When saving json object to a json column bigInteger value is saved wrong Uri Parush <urip@ensilo.com>
  0 siblings, 1 reply; 4+ messages in thread

From: Magnus Hagander @ 2018-07-03 09:17 UTC (permalink / raw)
  To: urip@ensilo.com; pgsql-bugs@lists.postgresql.org

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.

-- 
 Magnus Hagander
 Me: https://www.hagander.net/ <http://www.hagander.net/;
 Work: https://www.redpill-linpro.com/ <http://www.redpill-linpro.com/;

^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* RE: BUG #15260: When saving json object to a json column bigInteger value is saved wrong
  2018-07-03 09:13 BUG #15260: When saving json object to a json column bigInteger value is saved wrong PG Bug reporting form <noreply@postgresql.org>
  2018-07-03 09:17 ` Re: BUG #15260: When saving json object to a json column bigInteger value is saved wrong Magnus Hagander <magnus@hagander.net>
@ 2018-07-03 09:21   ` Uri Parush <urip@ensilo.com>
  2018-07-03 09:37     ` Re: BUG #15260: When saving json object to a json column bigInteger value is saved wrong Flo Rance <trourance@gmail.com>
  0 siblings, 1 reply; 4+ messages in thread

From: Uri Parush @ 2018-07-03 09:21 UTC (permalink / raw)
  To: Magnus Hagander <magnus@hagander.net>; pgsql-bugs@lists.postgresql.org

I’m 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.



-- 

 Magnus Hagander
 Me: https://www.hagander.net/ <http://www.hagander.net/;
 Work: https://www.redpill-linpro.com/ <http://www.redpill-linpro.com/;

^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: BUG #15260: When saving json object to a json column bigInteger value is saved wrong
  2018-07-03 09:13 BUG #15260: When saving json object to a json column bigInteger value is saved wrong PG Bug reporting form <noreply@postgresql.org>
  2018-07-03 09:17 ` Re: BUG #15260: When saving json object to a json column bigInteger value is saved wrong Magnus Hagander <magnus@hagander.net>
  2018-07-03 09:21   ` RE: BUG #15260: When saving json object to a json column bigInteger value is saved wrong Uri Parush <urip@ensilo.com>
@ 2018-07-03 09:37     ` Flo Rance <trourance@gmail.com>
  0 siblings, 0 replies; 4+ messages in thread

From: Flo Rance @ 2018-07-03 09:37 UTC (permalink / raw)
  To: Uri Parush <urip@ensilo.com>; +Cc: Magnus Hagander <magnus@hagander.net>; pgsql-bugs@lists.postgresql.org

I can reproduce this bug, at least with pgadmin4 2.1 (View Data -> All
rows).

You should take a look there to see if it has been already reported:
https://redmine.postgresql.org/projects/pgadmin4/issues

Regards,
Flo

On Tue, Jul 3, 2018 at 11:21 AM, Uri Parush <urip@ensilo.com> wrote:

> I’m 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.
>
>
>
> --
>
>  Magnus Hagander
>  Me: https://www.hagander.net/ <http://www.hagander.net/;
>  Work: https://www.redpill-linpro.com/ <http://www.redpill-linpro.com/;
>

Attachments:

Capture du 2018-07-03 11-36-02.png (image/png, 4.0K) download view image
^ permalink raw reply [nested|flat] 4+ messages in thread


end of thread, other threads:[~2018-07-03 09:37 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2018-07-03 09:13 BUG #15260: When saving json object to a json column bigInteger value is saved wrong PG Bug reporting form <noreply@postgresql.org>
2018-07-03 09:17 ` Magnus Hagander <magnus@hagander.net>
2018-07-03 09:21   ` Uri Parush <urip@ensilo.com>
2018-07-03 09:37     ` Flo Rance <trourance@gmail.com>

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