Skip site navigation (1) Skip section navigation (2)

pgsql: Measure epoch of timestamp-without-time-zone from local notUTC

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Measure epoch of timestamp-without-time-zone from local notUTC
Date: 2012-04-10 16:05:38
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-committers
Measure epoch of timestamp-without-time-zone from local not UTC midnight.

This patch reverts commit 191ef2b407f065544ceed5700e42400857d9270f
and thereby restores the pre-7.3 behavior of EXTRACT(EPOCH FROM
timestamp-without-tz).  Per discussion, the more recent behavior was
misguided on a couple of grounds: it makes it hard to get a
non-timezone-aware epoch value for a timestamp, and it makes this one
case dependent on the value of the timezone GUC, which is incompatible
with having timestamp_part() labeled as immutable.

The other behavior is still available (in all releases) by explicitly
casting the timestamp to timestamp with time zone before applying EXTRACT.

This will need to be called out as an incompatible change in the 9.2
release notes.  Although having mutable behavior in a function marked
immutable is clearly a bug, we're not going to back-patch such a change.



Modified Files
doc/src/sgml/func.sgml            |    4 +++-
src/backend/utils/adt/timestamp.c |   25 +++----------------------
2 files changed, 6 insertions(+), 23 deletions(-)

pgsql-committers by date

Next:From: Peter EisentrautDate: 2012-04-10 17:36:01
Subject: pgsql: psql: Improve tab completion of WITH
Previous:From: Heikki LinnakangasDate: 2012-04-10 06:53:57
Subject: pgsql: Point the URL to PL/py directly to the page about theprocedural

Privacy Policy | About PostgreSQL
Copyright © 1996-2018 The PostgreSQL Global Development Group