Michael Satterwhite <michael@weblore.com> writes:
> On Monday, December 27, 2010 12:58:40 pm Guillaume Lelarge wrote:
>> Le 27/12/2010 18:57, Michael Satterwhite a �crit :
>>> I'm obviously missing something ... and probably something obvious. Why
>>> is date2 still null?
>>
>> I'm not sure it'll help you. I copy/pasted your SQL script in my 9.0.2
>> release. Worked great.
> I'm running 8.4.2.
Well, as somebody already pointed out, the example you posted works
fine. When I try it in 8.4.6, I get
# select * from test;
date1 | date2
---------------------+---------------------
2012-05-04 00:00:00 | 2012-04-27 00:00:00
(1 row)
I find it interesting that your quoted result is
# select * from test;
date1 | date2
---------------------+-------
2012-04-27 00:00:00 |
(1 row)
What it looks like from here is there's a typo in the actually-executing
version of the function, such that date1 not date2 is assigned the
week-old date value. Perhaps "\df+ t_listing_startdate" would get
you started towards sorting it out.
regards, tom lane