Re: Interval Question - Mailing list pgsql-general

From Terry Lee Tucker
Subject Re: Interval Question
Date
Msg-id 200501111331.02537.terry@esc1.com
Whole thread Raw
In response to Interval Question  (Terry Lee Tucker <terry@esc1.com>)
List pgsql-general
Thanks for the answers.

By the way, I'm not trying to parse the textual output to discover if it is
netative. Apparently, I failed to communicate my purpose properly. I just
want to return the value, regardless of netative or positive, to the user and
store it in a column of type interval. I simply wanted it to show up as a
netative value if the load is going to be late.

Thanks for all the help...

On Tuesday 11 January 2005 01:19 pm, Tom Lane saith:
> Terry Lee Tucker <terry@esc1.com> writes:
> > Apparently, if DateStyle is set to Sql, it always returns the absolute
> > value. Is this due to some Sql standard or is it a bug?
>
> It's a bug in interval_out.  Looks like it gets it wrong for GERMAN
> style too.  Surprising no one noticed before.
>
> (In any case, I dunno why you are parsing the textual output to discover
> whether an interval is negative...)
>
>             regards, tom lane
>
> Soon-to-be-applied patch:
>
> *** src/backend/utils/adt/datetime.c.orig    Fri Dec 31 17:46:13 2004
> --- src/backend/utils/adt/datetime.c    Tue Jan 11 13:13:30 2005
> ***************
> *** 3932,3938 ****
>           cp += strlen(cp);
>       }
>
> !     if (is_before && (style == USE_POSTGRES_DATES))
>       {
>           strcat(cp, " ago");
>           cp += strlen(cp);
> --- 3932,3938 ----
>           cp += strlen(cp);
>       }
>
> !     if (is_before && (style != USE_ISO_DATES))
>       {
>           strcat(cp, " ago");
>           cp += strlen(cp);

--
Quote: 83
"Government is not the solution to our problem. Government is the
 problem."

 --Ronald Reagan

 Work: 1-336-372-6812
 Cell: 1-336-363-4719
email: terry@esc1.com

pgsql-general by date:

Previous
From: Chris
Date:
Subject: Re: Limiting USAGE to only certain objects within a schema
Next
From: Richard Huxton
Date:
Subject: Re: Private or publice function