mirror of
https://github.com/postgres/postgres.git
synced 2025-07-02 09:02:37 +03:00
Fix incorrect translation of minus-infinity datetimes for json/jsonb.
Commit bda76c1c8c
caused both plus and
minus infinity to be rendered as "infinity", which is not only wrong
but inconsistent with the pre-9.4 behavior of to_json(). Fix that by
duplicating the coding in date_out/timestamp_out/timestamptz_out more
closely. Per bug #13687 from Stepan Perlov. Back-patch to 9.4, like
the previous commit.
In passing, also re-pgindent json.c, since it had gotten a bit messed up by
recent patches (and I was already annoyed by indentation-related problems
in back-patching this fix ...)
This commit is contained in:
@ -116,8 +116,11 @@ COMMIT;
|
||||
select to_json(date '2014-05-28');
|
||||
|
||||
select to_json(date 'Infinity');
|
||||
select to_json(date '-Infinity');
|
||||
select to_json(timestamp 'Infinity');
|
||||
select to_json(timestamp '-Infinity');
|
||||
select to_json(timestamptz 'Infinity');
|
||||
select to_json(timestamptz '-Infinity');
|
||||
|
||||
--json_agg
|
||||
|
||||
|
Reference in New Issue
Block a user