• Tom Lane's avatar
    Measure epoch of timestamp-without-time-zone from local not UTC midnight. · 0d9819f7
    Tom Lane authored
    This patch reverts commit 191ef2b4
    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.
    0d9819f7
timestamp.c 116 KB