Re: Conversion to 8.3

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Terry Lee Tucker <terry(at)chosen-ones(dot)org>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Conversion to 8.3
Date: 2008-04-04 20:36:12
Message-ID: 7943.1207341372@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Terry Lee Tucker <terry(at)chosen-ones(dot)org> writes:
> I am converting our application from 7.4.19 to 8.3.1. In the old scheme of
> things, I was generating an interval between two timestamps and evaluating
> the interval string in another set of trigger code. I was doing the
> following:
> IF new.ontime IS NOT NULL AND new.ontime ~* 'ago' THEN
> With the new casting rules, this doesn't work.

Well, you could force it to work by casting new.ontime to text
explicitly, but this is a pretty horrid way of testing for a negative
interval anyhow. I'd be inclined to do something like
new.ontime < '0 seconds'

BTW, the IS NOT NULL test is redundant too, since the comparison
can't succeed for a null.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Terry Lee Tucker 2008-04-04 20:39:51 Re: Conversion to 8.3
Previous Message Tom Lane 2008-04-04 20:27:43 Re: modules