Re: to_char not IMMUTABLE?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Mario Weilguni <mweilguni(at)sime(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org, Martijn van Oosterhout <kleptog(at)svana(dot)org>
Subject: Re: to_char not IMMUTABLE?
Date: 2007-01-12 14:39:34
Message-ID: 6487.1168612774@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Mario Weilguni <mweilguni(at)sime(dot)com> writes:
> Thanks for the info. Changing this to use extract is no real problem, I was
> just curious if this is intendend behaviour.

From the CVS logs:

2006-11-28 14:18 tgl

* src/include/catalog/: pg_proc.h (REL7_3_STABLE), pg_proc.h
(REL7_4_STABLE), pg_proc.h (REL8_1_STABLE), pg_proc.h
(REL8_0_STABLE): Mark to_number() and the numeric-type variants of
to_char() as stable, not immutable, because their results depend on
lc_numeric; this is a longstanding oversight. We cannot force
initdb for this in the back branches, but we can at least provide
correct catalog entries for future installations.

2006-11-28 14:18 tgl

* src/include/catalog/pg_proc.h: Mark to_char(timestamp without
timezone) as stable, not immutable, since its result now depends on
the lc_messages setting, as noted by Bruce. Also, mark to_number()
and the numeric-type variants of to_char() as stable, because their
results depend on lc_numeric; this is a longstanding oversight.
Also, mark to_date() and to_char(interval) as stable; although
these appear not to depend on any GUC variables as of CVS HEAD,
that seems a property unlikely to survive future improvements. It
seems best to mark all the formatting functions stable and be done
with it. catversion not bumped, because this does not seem
critical enough to force a post-RC1 initdb, and anyway we cannot do
so in the back branches.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Albe Laurenz 2007-01-12 14:42:07 Re: to_char not IMMUTABLE?
Previous Message Alvaro Herrera 2007-01-12 14:38:07 Re: Corrupt database? 8.1/FreeBSD6.0