diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2012-04-10 12:04:42 -0400 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2012-04-10 12:04:42 -0400 |
commit | 0d9819f7e3be3c4186f0398d007d2fef8809da6a (patch) | |
tree | 5310eb1acea93bd00fe3516985df38cfdb921636 /doc/src | |
parent | 442da68f73e679ae8a799c249e3bf1fc1a3ee28d (diff) | |
download | postgresql-0d9819f7e3be3c4186f0398d007d2fef8809da6a.tar.gz postgresql-0d9819f7e3be3c4186f0398d007d2fef8809da6a.zip |
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.
Diffstat (limited to 'doc/src')
-rw-r--r-- | doc/src/sgml/func.sgml | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml index 34fea16eeee..ae22ee5f7fa 100644 --- a/doc/src/sgml/func.sgml +++ b/doc/src/sgml/func.sgml @@ -6684,8 +6684,10 @@ SELECT EXTRACT(DOY FROM TIMESTAMP '2001-02-16 20:38:40'); <term><literal>epoch</literal></term> <listitem> <para> - For <type>date</type> and <type>timestamp</type> values, the + For <type>timestamp with time zone</type> values, the number of seconds since 1970-01-01 00:00:00 UTC (can be negative); + for <type>date</type> and <type>timestamp</type> values, the + number of seconds since 1970-01-01 00:00:00 local time; for <type>interval</type> values, the total number of seconds in the interval </para> |