On Wed, Nov 30, 2011 at 5:10 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> The result of parse analysis for that query is a stored date constant
> (in a Const node) with a cast-to-text on top of it. The system is aware
> that cast-date-to-text isn't immutable, so it doesn't try to fold the
> cast operation. When you execute the query, it displays the date
> constant using the now-current datestyle.
Another thought: why does it execute the type input function (which is
dependent on a GUC), but not the cast?
Regards,
Jeff Davis