From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Add a timezone-specific variant of date_trunc().
Date: Wed, 14 Nov 2018 20:41:14 +0000
Message-ID: <E1gN1yM-0004ex-Md@gemulon.postgresql.org> (raw)
Add a timezone-specific variant of date_trunc().
date_trunc(field, timestamptz, zone_name) performs truncation using
the named time zone as reference, rather than working in the session
time zone as is the default behavior. It's equivalent to
date_trunc(field, timestamptz at time zone zone_name) at time zone zone_name
but it's faster, easier to type, and arguably easier to understand.
Vik Fearing and Tom Lane
Discussion: https://postgr.es/m/6249ffc4-2b22-4c1b-4e7d-7af84fedd7c6@2ndquadrant.com
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/600b04d6b5ef6c9ad3ea684aad40260bd60d5872
Modified Files
--------------
doc/src/sgml/func.sgml | 53 ++++++++++++++---
src/backend/utils/adt/timestamp.c | 97 +++++++++++++++++++++++++++----
src/include/catalog/catversion.h | 2 +-
src/include/catalog/pg_proc.dat | 19 +++---
src/test/regress/expected/timestamptz.out | 18 ++++++
src/test/regress/sql/timestamptz.sql | 4 ++
6 files changed, 166 insertions(+), 27 deletions(-)
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: tgl@sss.pgh.pa.us
Subject: Re: pgsql: Add a timezone-specific variant of date_trunc().
In-Reply-To: <E1gN1yM-0004ex-Md@gemulon.postgresql.org>
References: <E1gN1yM-0004ex-Md@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