Re: BUG #13687: bug in row_to_json function with '-infinity' timestamp - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #13687: bug in row_to_json function with '-infinity' timestamp
Date
Msg-id 31798.1445291860@sss.pgh.pa.us
Whole thread Raw
In response to Re: BUG #13687: bug in row_to_json function with '-infinity' timestamp  (Petr Jelinek <petr@2ndquadrant.com>)
Responses Re: BUG #13687: bug in row_to_json function with '-infinity' timestamp  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
Petr Jelinek <petr@2ndquadrant.com> writes:
> On 2015-10-19 17:31, Tom Lane wrote:
>> So I see.  Apparently we broke something during 9.4 devel.

> Yeah it's the commits c00c3249e and bda76c1c8. First one changed the
> output to not use to_char so that we could produce correct ISO timestamp
> and disallowed the infinity altogether, the second added custom handling
> for infinity, but the code does not differentiate between negative and
> positive infinity. I think the json code does not need to have custom
> handling of infinity but could just call the EncodeSpecialTimestamp() if
> it was exported from the timestamp module.

Meh.  We'd have to change its API too, because it is expecting to print
into a fixed buffer.  I think probably easier to just duplicate the check.

            regards, tom lane

pgsql-bugs by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: BUG #13687: bug in row_to_json function with '-infinity' timestamp
Next
From: Michael Paquier
Date:
Subject: Re: BUG #13685: Archiving while idle every archive_timeout with wal_level hot_standby