| From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
|---|---|
| To: | pgsql-committers(at)postgresql(dot)org |
| Subject: | pgsql: Fix incorrect translation of minus-infinity datetimes for json/j |
| Date: | 2015-10-20 18:07:17 |
| Message-ID: | E1ZobJd-0002GS-88@gemulon.postgresql.org |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-committers |
Fix incorrect translation of minus-infinity datetimes for json/jsonb.
Commit bda76c1c8cfb1d11751ba6be88f0242850481733 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 ...)
Branch
------
REL9_4_STABLE
Details
-------
http://git.postgresql.org/pg/commitdiff/4f33572ee68b515dc2750e265fc0d0312c0d5d3d
Modified Files
--------------
src/backend/utils/adt/date.c | 3 +--
src/backend/utils/adt/json.c | 36 ++++++++++--------------------------
src/backend/utils/adt/timestamp.c | 3 +--
src/include/utils/date.h | 1 +
src/include/utils/datetime.h | 1 +
src/test/regress/expected/json.out | 18 ++++++++++++++++++
src/test/regress/sql/json.sql | 3 +++
7 files changed, 35 insertions(+), 30 deletions(-)
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Peter Eisentraut | 2015-10-22 02:33:40 | pgsql: doc: Improve markup and fine-tune replication protocol documenta |
| Previous Message | Peter Eisentraut | 2015-10-20 17:36:16 | pgsql: doc: Move documentation of max_wal_size to better position |