Re: [HACKERS] Why extract( ... from timestamp ) is not immutable? - Mailing list pgsql-general

From hubert depesz lubaczewski
Subject Re: [HACKERS] Why extract( ... from timestamp ) is not immutable?
Date
Msg-id 20120130172859.GB8109@depesz.com
Whole thread Raw
In response to Re: Why extract( ... from timestamp ) is not immutable?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
On Wed, Jan 25, 2012 at 11:30:49AM -0500, Tom Lane wrote:
> hubert depesz lubaczewski <depesz@depesz.com> writes:
> > anyway - the point is that in \df date_part(, timestamp) says it's
> > immutable, while it is not.
>
> Hmm, you're right.  I thought we'd fixed that way back when, but
> obviously not.  Or maybe the current behavior of the epoch case
> postdates that.

is there a chance something will happen with/about it?

preferably I would see extract( epoch from timestamp ) to be really
immutable, i.e. (in my opinion) it should treat incoming data as UTC
- for epoch calculation.
Alternatively - perhaps epoch extraction should be moved to specialized
function, which would have swapped mutability:

get_epoch(timestamptz) would be immutable
while
get_epoch(timestamp) would be stable

Best regards,

depesz

--
The best thing about modern society is how easy it is to avoid contact with it.
                                                             http://depesz.com/

pgsql-general by date:

Previous
From: hubert depesz lubaczewski
Date:
Subject: Re: pg_dump -s dumps data?!
Next
From: Adrian Klaver
Date:
Subject: Re: pg_dump -s dumps data?!