Re: [BUGS] possible bug seen with -DCLOBBER_CACHE_ALWAYS and changing GUCs

2011-12-05 Thread Tom Lane
Jeff Davis writes: > On Wed, Nov 30, 2011 at 5:10 PM, Tom Lane 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 >> ca

Re: [BUGS] possible bug seen with -DCLOBBER_CACHE_ALWAYS and changing GUCs

2011-12-05 Thread Jeff Davis
On Wed, Nov 30, 2011 at 5:10 PM, Tom Lane 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 ex

Re: [BUGS] possible bug seen with -DCLOBBER_CACHE_ALWAYS and changing GUCs

2011-12-04 Thread Noah Misch
On Wed, Nov 30, 2011 at 08:10:22PM -0500, Tom Lane wrote: > Jeff Davis writes: > > SQL: > > set datestyle to postgres,us; > > prepare stmt as select '02-01-2011'::date::text; > > execute stmt; > > set datestyle to postgres,euro; > > execute stmt; > > deallocate stmt; > > > The results

Re: [BUGS] possible bug seen with -DCLOBBER_CACHE_ALWAYS and changing GUCs

2011-11-30 Thread Jeff Davis
On Wed, 2011-11-30 at 20:10 -0500, Tom Lane wrote: > I believe what is happening in the second case is that the query is > getting re-parse-analyzed, from scratch, and since now datestyle is > different (DMY not MDY), the date literal gets interpreted differently. > You could argue it either way as

Re: [BUGS] possible bug seen with -DCLOBBER_CACHE_ALWAYS and changing GUCs

2011-11-30 Thread Tom Lane
Jeff Davis writes: > SQL: > set datestyle to postgres,us; > prepare stmt as select '02-01-2011'::date::text; > execute stmt; > set datestyle to postgres,euro; > execute stmt; > deallocate stmt; > The results I get with normal debug compilation are: > SET > PREPARE > text >