Re: to_char not IMMUTABLE?

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Mario Weilguni <mweilguni(at)sime(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: to_char not IMMUTABLE?
Date: 2007-01-12 13:48:59
Message-ID: 20070112134859.GB11291@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Jan 12, 2007 at 11:55:07AM +0100, Mario Weilguni wrote:
> to_char(timestamp, 'yyyy') should be constant and marked immutable,
> or am I wrong here? Or is it not marked immutable because of possible
> changes on date_format?

AIUI, to_char is not immutable because it can be effected by external
variables, like LC_TIME.

As it is though, I'm not sure why you're using to_char here, surely
extract or date_truc would be more appropriate?

Have a nice day,
--
Martijn van Oosterhout <kleptog(at)svana(dot)org> http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2007-01-12 13:55:52 Re: Corrupt database? 8.1/FreeBSD6.0
Previous Message Jeff Amiel 2007-01-12 13:48:35 Re: Corrupt database? 8.1/FreeBSD6.0