Re: Help with trigger

From: Michael Satterwhite <michael(at)weblore(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Help with trigger
Date: 2011-01-06 16:44:29
Message-ID: 201101061044.29974.michael@weblore.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Monday, December 27, 2010 03:36:35 pm you wrote:
> Michael Satterwhite <michael(at)weblore(dot)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.

You nailed it. I found what was happening - and it works (as everyone said it
should). I apologize for not seeing the obvious!

Thanks to everyone!

Browse pgsql-general by date

  From Date Subject
Next Message Chris Browne 2011-01-06 16:51:25 Re: UUID column as pimrary key?
Previous Message Chris Browne 2011-01-06 16:31:38 Re: UUID column as pimrary key?