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 dep...@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

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

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

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 dep...@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

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't

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 to

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

2012-01-30 Thread Tom Lane
hubert depesz lubaczewski dep...@depesz.com 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

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 dep...@depesz.com 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

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

2012-01-30 Thread Tom Lane
Josh Berkus j...@agliodbs.com 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

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

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