aboutsummaryrefslogtreecommitdiff
path: root/src/include/utils/datetime.h
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2015-10-20 11:06:24 -0700
committerTom Lane <tgl@sss.pgh.pa.us>2015-10-20 11:07:04 -0700
commitd4355425831fe8f6a68095393e3628cb30d06b3f (patch)
tree205b0f8d5b11ff62b923090f76ca489bbb48ba84 /src/include/utils/datetime.h
parent984ae04a2c35e4cd0066ef2e2fb364299ff51c36 (diff)
downloadpostgresql-d4355425831fe8f6a68095393e3628cb30d06b3f.tar.gz
postgresql-d4355425831fe8f6a68095393e3628cb30d06b3f.zip
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 ...)
Diffstat (limited to 'src/include/utils/datetime.h')
-rw-r--r--src/include/utils/datetime.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/include/utils/datetime.h b/src/include/utils/datetime.h
index 5b86ca10ef6..e9a1ecebeb7 100644
--- a/src/include/utils/datetime.h
+++ b/src/include/utils/datetime.h
@@ -326,6 +326,7 @@ extern void EncodeDateOnly(struct pg_tm * tm, int style, char *str);
extern void EncodeTimeOnly(struct pg_tm * tm, fsec_t fsec, bool print_tz, int tz, int style, char *str);
extern void EncodeDateTime(struct pg_tm * tm, fsec_t fsec, bool print_tz, int tz, const char *tzn, int style, char *str);
extern void EncodeInterval(struct pg_tm * tm, fsec_t fsec, int style, char *str);
+extern void EncodeSpecialTimestamp(Timestamp dt, char *str);
extern int ValidateDate(int fmask, bool isjulian, bool is2digits, bool bc,
struct pg_tm * tm);