| From: | Terry Lee Tucker <terry(at)esc1(dot)com> | 
|---|---|
| To: | pgsql-general(at)postgresql(dot)org | 
| Subject: | Re: Interval Question | 
| Date: | 2005-01-11 18:31:02 | 
| Message-ID: | 200501111331.02537.terry@esc1.com | 
| Views: | Whole Thread | Raw Message | Download mbox | Resend email | 
| Thread: | |
| Lists: | 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(at)esc1(dot)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(at)esc1(dot)com
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Richard Huxton | 2005-01-11 18:36:17 | Re: Private or publice function | 
| Previous Message | Chris | 2005-01-11 18:29:59 | Re: Limiting USAGE to only certain objects within a schema |