pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Fix incorrect translation of minus-infinity datetimes for json/j
3+ messages / 1 participants
[nested] [flat]

* pgsql: Fix incorrect translation of minus-infinity datetimes for json/j
@ 2015-10-20 18:07 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 3+ messages in thread

From: Tom Lane @ 2015-10-20 18:07 UTC (permalink / raw)
  To: 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
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/d4355425831fe8f6a68095393e3628cb30d06b3f

Modified Files
--------------
src/backend/utils/adt/date.c        |    3 +-
src/backend/utils/adt/json.c        |   72 ++++++++++++++---------------------
src/backend/utils/adt/jsonb.c       |   54 ++++++++------------------
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/expected/jsonb.out |   18 +++++++++
src/test/regress/sql/json.sql       |    3 ++
src/test/regress/sql/jsonb.sql      |    3 ++
10 files changed, 90 insertions(+), 86 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


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

* pgsql: Fix incorrect translation of minus-infinity datetimes for json/j
@ 2015-10-20 18:07 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 3+ messages in thread

From: Tom Lane @ 2015-10-20 18:07 UTC (permalink / raw)
  To: 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_5_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/5fb20a5ba6ce963ad529224ff5359aa1731c4068

Modified Files
--------------
src/backend/utils/adt/date.c        |    3 +-
src/backend/utils/adt/json.c        |   72 ++++++++++++++---------------------
src/backend/utils/adt/jsonb.c       |   54 ++++++++------------------
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/expected/jsonb.out |   18 +++++++++
src/test/regress/sql/json.sql       |    3 ++
src/test/regress/sql/jsonb.sql      |    3 ++
10 files changed, 90 insertions(+), 86 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


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

* pgsql: Fix incorrect translation of minus-infinity datetimes for json/j
@ 2015-10-20 18:07 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 3+ messages in thread

From: Tom Lane @ 2015-10-20 18:07 UTC (permalink / raw)
  To: 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(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


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


end of thread, other threads:[~2015-10-20 18:07 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2015-10-20 18:07 pgsql: Fix incorrect translation of minus-infinity datetimes for json/j Tom Lane <tgl@sss.pgh.pa.us>
2015-10-20 18:07 pgsql: Fix incorrect translation of minus-infinity datetimes for json/j Tom Lane <tgl@sss.pgh.pa.us>
2015-10-20 18:07 pgsql: Fix incorrect translation of minus-infinity datetimes for json/j Tom Lane <tgl@sss.pgh.pa.us>

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