From: Bruce Momjian Date: Sat, 25 Aug 2012 21:44:53 +0000 (-0400) Subject: Allow text timezone designations, e.g. "America/Chicago", when using the X-Git-Tag: REL9_3_BETA1~1029 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3e1a373e2b102b43faa8bbc4841f7511174e1166;p=postgresql Allow text timezone designations, e.g. "America/Chicago", when using the ISO "T" timestamptz format. --- diff --git a/src/backend/utils/adt/datetime.c b/src/backend/utils/adt/datetime.c index 26c6742e8b..c29b8e1019 100644 --- a/src/backend/utils/adt/datetime.c +++ b/src/backend/utils/adt/datetime.c @@ -944,6 +944,16 @@ DecodeDateTime(char **field, int *ftype, int nf, break; case DTK_TIME: + /* + * This might be an ISO time following a "t" field. + */ + if (ptype != 0) + { + /* Sanity check; should not fail this test */ + if (ptype != DTK_TIME) + return DTERR_BAD_FORMAT; + ptype = 0; + } dterr = DecodeTime(field[i], fmask, INTERVAL_FULL_RANGE, &tmask, tm, fsec); if (dterr)