diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/backend/utils/adt/timestamp.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/backend/utils/adt/timestamp.c b/src/backend/utils/adt/timestamp.c index 84bc97d40c3..90ebb50e1f5 100644 --- a/src/backend/utils/adt/timestamp.c +++ b/src/backend/utils/adt/timestamp.c @@ -5210,8 +5210,17 @@ timestamp2timestamptz_opt_error(Timestamp timestamp, bool *have_error) { tz = DetermineTimeZoneOffset(tm, session_timezone); - if (!tm2timestamp(tm, fsec, &tz, &result)) + result = dt2local(timestamp, -tz); + + if (IS_VALID_TIMESTAMP(result)) + { return result; + } + else if (have_error) + { + *have_error = true; + return (TimestampTz) 0; + } } if (have_error) |