pgsql: Refactor timestamp2timestamptz_opt_error() - Mailing list pgsql-committers

From Alexander Korotkov
Subject pgsql: Refactor timestamp2timestamptz_opt_error()
Date
Msg-id E1iMe1i-00082X-5G@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Refactor timestamp2timestamptz_opt_error()

While casting from timestamp to timestamptz we do timestamp2tm() then
tm2timestamp().  This commit eliminates call to tm2timestamp().  Instead, it
directly applies timezone offset to the original timestamp value.  That makes
upcoming datetime overflow handling in jsonpath easier.  That should also save
us some CPU cycles.

Discussion: https://postgr.es/m/CAPpHfdvRPRh_mTGar5WmDeRZ%3DU5dOXHdxspYYD%3D76m3knNGjXA%40mail.gmail.com
Author: Alexander Korotkov
Reviewed-by: Tom Lane

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/a6888fde7f0dbe865559b31ba2ce01ac1150debe

Modified Files
--------------
src/backend/utils/adt/timestamp.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)


pgsql-committers by date:

Previous
From: Tom Lane
Date:
Subject: pgsql: Deal with yet another issue related to "Norwegian (Bokmål)" loca
Next
From: Peter Eisentraut
Date:
Subject: Re: pgsql: Fix parsing of integer values for connection parameters inlibpq