pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alexander Korotkov <akorotkov@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Refactor timestamp2timestamptz_opt_error()
Date: Mon, 21 Oct 2019 20:11:38 +0000
Message-ID: <E1iMe1i-00082X-5G@gemulon.postgresql.org> (raw)

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(-)



Message-ID: <E1iMe1i-00082X-5G@gemulon.postgresql.org>
Permalink:  ../E1iMe1i-00082X-5G@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1iMe1i-00082X-5G@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: akorotkov@postgresql.org
  Subject: Re: pgsql: Refactor timestamp2timestamptz_opt_error()
  In-Reply-To: <E1iMe1i-00082X-5G@gemulon.postgresql.org>
  References: <E1iMe1i-00082X-5G@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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