Search Postgresql Archives

Re: Interval Question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Terry Lee Tucker <terry@xxxxxxxx> 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);

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux