Re: Conversion to 8.3

From: Terry Lee Tucker <terry(at)chosen-ones(dot)org>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Conversion to 8.3
Date: 2008-04-07 10:21:39
Message-ID: 200804070621.39672.terry@chosen-ones.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Saturday 05 April 2008 11:21, Tom Lane wrote:
> "Scott Marlowe" <scott(dot)marlowe(at)gmail(dot)com> writes:
> > what type is new.ontime ?? timestamp or interval. I would expect it
> > to be an interval. But intervals are either negative or positive, not
> > "ago" unless that's something peculiar to 7.4 that I've long since
> > forgotten.
>
> No, it's still around:
>
> regression=# select '-1 day'::interval;
> interval
> ----------
> -1 days
> (1 row)
>
> regression=# set datestyle = postgres;
> SET
> regression=# select '-1 day'::interval;
> interval
> -------------
> @ 1 day ago
> (1 row)
>
> The most bletcherous aspect of Terry's original coding is that it fails
> entirely, and silently, if the DateStyle setting isn't what it's
> assuming...
>
> regards, tom lane

Well, I didn't realize that "ago" was only applicable to a certain date style
setting. I don't recall ever reading that anywhere but maybe I missed it. Now
I know how to do it correctly.

Thanks to all who responded...
--
Terry Lee Tucker
Turbo's IT Manager
Turbo, division of Ozburn-Hessey Logistics
2251 Jesse Jewell Pkwy NE
Gainesville, GA 30501
Tel: (336) 372-6812 Fax: (336) 372-6812 Cell: (336) 404-6987
terry(at)turbocorp(dot)com
www.turbocorp.com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Roberts, Jon 2008-04-07 12:12:02 Re: calendar best practices for postgres
Previous Message josep porres 2008-04-07 10:08:09 Re: edb-debugger, debugging pl/pgsql