Re: [HACKERS] [GENERAL] Why extract( ... from timestamp ) is not immutable?

2012-08-27 Thread Tom Lane
Bruce Momjian writes: > On Wed, Jan 25, 2012 at 11:30:49AM -0500, Tom Lane wrote: >> hubert depesz lubaczewski 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 >> obvi

Re: [HACKERS] [GENERAL] Why extract( ... from timestamp ) is not immutable?

2012-08-27 Thread Bruce Momjian
On Wed, Jan 25, 2012 at 11:30:49AM -0500, Tom Lane wrote: > hubert depesz lubaczewski 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

Re: [HACKERS] [GENERAL] Why extract( ... from timestamp ) is not immutable?

2012-01-30 Thread Tom Lane
Josh Berkus writes: > On 1/30/12 5:41 PM, Tom Lane wrote: >> Well, the current marking is clearly incorrect. What to do about that >> is a bit less clear --- should we downgrade the marking, or change the >> function's behavior so that it really is immutable? > AFAIK, the only case which is NOT

Re: [HACKERS] [GENERAL] Why extract( ... from timestamp ) is not immutable?

2012-01-30 Thread Josh Berkus
On 1/30/12 5:41 PM, Tom Lane wrote: > hubert depesz lubaczewski writes: >> On Mon, Jan 30, 2012 at 10:35:21AM -0800, Josh Berkus wrote: >>> We can't have functions which are immutable or not depending on their >>> inputs. That way lies madness. > >> but this is exactly what's happening now. > >

Re: [HACKERS] [GENERAL] Why extract( ... from timestamp ) is not immutable?

2012-01-30 Thread Tom Lane
hubert depesz lubaczewski writes: > On Mon, Jan 30, 2012 at 10:35:21AM -0800, Josh Berkus wrote: >> We can't have functions which are immutable or not depending on their >> inputs. That way lies madness. > but this is exactly what's happening now. Well, the current marking is clearly incorrect.

Re: [HACKERS] [GENERAL] Why extract( ... from timestamp ) is not immutable?

2012-01-30 Thread hubert depesz lubaczewski
On Mon, Jan 30, 2012 at 10:35:21AM -0800, Josh Berkus wrote: > > > 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

Re: [HACKERS] [GENERAL] Why extract( ... from timestamp ) is not immutable?

2012-01-30 Thread Josh Berkus
> 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: We can

Re: [HACKERS] [GENERAL] Why extract( ... from timestamp ) is not immutable?

2012-01-30 Thread hubert depesz lubaczewski
On Wed, Jan 25, 2012 at 11:30:49AM -0500, Tom Lane wrote: > hubert depesz lubaczewski 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

Re: [HACKERS] [GENERAL] Why extract( ... from timestamp ) is not immutable?

2012-01-25 Thread Tom Lane
hubert depesz lubaczewski 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.