I wrote:
> Apparently somebody's confused between local and GMT time somewhere in
> there.
For the archives' sake: this turns out to be a portability issue not
handled by the git code. If you are running on a platform old enough
to have gmtime_r returning int rather than struct tm *, you need this
patch:
*** date.c~ Sat Sep 18 19:43:54 2010
--- date.c Fri Sep 24 10:57:28 2010
***************
*** 406,412 ****
case '.':
now = time(NULL);
refuse_future = NULL;
! if (gmtime_r(&now, &now_tm))
refuse_future = &now_tm;
if (num > 70) {
--- 406,412 ----
case '.':
now = time(NULL);
refuse_future = NULL;
! if (gmtime_r(&now, &now_tm) == 0)
refuse_future = &now_tm;
if (num > 70) {
***************
*** 469,475 ****
*/
if (num >= 100000000 && nodate(tm)) {
time_t time = num;
! if (gmtime_r(&time, tm)) {
*tm_gmt = 1;
return end - date;
}
--- 469,475 ----
*/
if (num >= 100000000 && nodate(tm)) {
time_t time = num;
! if (gmtime_r(&time, tm) == 0) {
*tm_gmt = 1;
return end - date;
}
[ /me resolves to actually run a program's regression tests before
assuming it works ]
regards, tom lane
--
Sent via pgsql-hackers mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers