Dear All,
	There are differences in the regression tests for PostgreSQL
7.3b2 with handling of times before 1970. I recently sent out a set of
diffs for the changes. I've looked through the datetime.c code, but
it's not obvious to me what the cause of the change is. PostgreSQL 7.2
works fine on Irix for these cases.
	Can anyone familiar with the code please take a look
at the diffs and identify where the trouble may be? I'd be happy
to rerun the regression tests to help diagnose the problem.

--Bob

+-----------------------------+------------------------------------+
| Robert E. Bruccoleri, Ph.D. | email: bruc@acm.org                |
| P.O. Box 314                | URL:   http://www.congen.com/~bruc |
| Pennington, NJ 08534        |                                    |
+-----------------------------+------------------------------------+

Fri, 8 Nov 2002 16:33:42 -0500 (EST)
"Robert E. Bruccoleri" <bruc@stone.congenomics.com>
Problem with 7.3 on Irix with dates before 1970
"Robert E. Bruccoleri" <bruc@stone.congenomics.com> writes:
> 	There are differences in the regression tests for PostgreSQL
> 7.3b2 with handling of times before 1970. I recently sent out a set of
> diffs for the changes. I've looked through the datetime.c code, but
> it's not obvious to me what the cause of the change is. PostgreSQL 7.2
> works fine on Irix for these cases.

I have a feeling that it's got something to do with the workaround for
broken mktime() that I recently put in.  Could you try this experiment
and see what you get?  (This should at least tell us whether the
variance from common behavior is on the input side or the output side.)

regression=# set TimeZone TO 'PST8PDT';
SET
regression=# select abstime 'May 10, 1947 23:59:12';
        abstime
------------------------
 1947-05-10 23:59:12-08
(1 row)

regression=# select (abstime 'May 10, 1947 23:59:12')::int4;
    int4
------------
 -714585648
(1 row)


			regards, tom lane

Fri, 08 Nov 2002 16:48:21 -0500
Tom Lane <tgl@sss.pgh.pa.us>
Re: Problem with 7.3 on Irix with dates before 1970 
Dear Tom,
	Here's the result of your queries:

template1=# set TimeZone TO 'PST8PDT';
SET
template1=# select abstime 'May 10, 1947 23:59:12';
        abstime
------------------------
 1947-05-10 22:59:12-08
(1 row)

template1=# select (abstime 'May 10, 1947 23:59:12')::int4;
    int4
------------
 -714589248
(1 row)

--Bob
> 
> 
> "Robert E. Bruccoleri" <bruc@stone.congenomics.com> writes:
> > 	There are differences in the regression tests for PostgreSQL
> > 7.3b2 with handling of times before 1970. I recently sent out a set of
> > diffs for the changes. I've looked through the datetime.c code, but
> > it's not obvious to me what the cause of the change is. PostgreSQL 7.2
> > works fine on Irix for these cases.
> 
> I have a feeling that it's got something to do with the workaround for
> broken mktime() that I recently put in.  Could you try this experiment
> and see what you get?  (This should at least tell us whether the
> variance from common behavior is on the input side or the output side.)
> 
> regression=# set TimeZone TO 'PST8PDT';
> SET
> regression=# select abstime 'May 10, 1947 23:59:12';
>         abstime
> ------------------------
>  1947-05-10 23:59:12-08
> (1 row)
> 
> regression=# select (abstime 'May 10, 1947 23:59:12')::int4;
>     int4
> ------------
>  -714585648
> (1 row)
> 
> 
> 			regards, tom lane
> 

+-----------------------------+------------------------------------+
| Robert E. Bruccoleri, Ph.D. | email: bruc@acm.org                |
| P.O. Box 314                | URL:   http://www.congen.com/~bruc |
| Pennington, NJ 08534        |                                    |
+-----------------------------+------------------------------------+

Fri, 8 Nov 2002 17:31:20 -0500 (EST)
"Robert E. Bruccoleri" <bruc@stone.congenomics.com>
Re: Problem with 7.3 on Irix with dates before 1970
"Robert E. Bruccoleri" <bruc@stone.congenomics.com> writes:
> There are differences in the regression tests for PostgreSQL
> 7.3b2 with handling of times before 1970. I recently sent out a set of
> diffs for the changes. I've looked through the datetime.c code, but
> it's not obvious to me what the cause of the change is. PostgreSQL 7.2
> works fine on Irix for these cases.

Waitasec ... are you using src/include/port/irix5.h as the port-specific
config file?  (Check the symlink src/include/pg_config_os.h to find
out.)  If so, try removing "#define NO_MKTIME_BEFORE_1970" from irix5.h
and see if things get better.  I asked awhile ago if that symbol was
still needed given the mktime workaround, but no one got back to me on
it.

My current theory is that once you remove that symbol, you will get
results matching the Solaris expected files --- ie, I suspect that your
system believes there was DST in 1947.  Do you have a way of verifying
that theory by looking at the system timezone database?

			regards, tom lane

Sat, 09 Nov 2002 11:17:58 -0500
Tom Lane <tgl@sss.pgh.pa.us>
Re: Problem with 7.3 on Irix with dates before 1970 
Dear Tom,
	I have removed the NO_MKTIME_BEFORE_1970 symbol from irix5.h,
rebuilt 7.3b2, and reran the regression. The three time tests
(tinterval, horology, abstime) now match the Solaris expected files.
	I checked the timezone files, and the system does not appear to
have savings time defined for 1947, but it does report it as such
in the PostgreSQL regression tests.
	WRT your old message about the mktime workaround, I must have
missed your message. However, in the future, if you want something
tested on Irix, please let me know. I use PostgreSQL a fair amount at
Bristol-Myers Squibb, and I will spend some time to keep it working.

					Sincerely,
					Bob

> 
> 
> "Robert E. Bruccoleri" <bruc@stone.congenomics.com> writes:
> > There are differences in the regression tests for PostgreSQL
> > 7.3b2 with handling of times before 1970. I recently sent out a set of
> > diffs for the changes. I've looked through the datetime.c code, but
> > it's not obvious to me what the cause of the change is. PostgreSQL 7.2
> > works fine on Irix for these cases.
> 
> Waitasec ... are you using src/include/port/irix5.h as the port-specific
> config file?  (Check the symlink src/include/pg_config_os.h to find
> out.)  If so, try removing "#define NO_MKTIME_BEFORE_1970" from irix5.h
> and see if things get better.  I asked awhile ago if that symbol was
> still needed given the mktime workaround, but no one got back to me on
> it.
> 
> My current theory is that once you remove that symbol, you will get
> results matching the Solaris expected files --- ie, I suspect that your
> system believes there was DST in 1947.  Do you have a way of verifying
> that theory by looking at the system timezone database?
> 
> 			regards, tom lane
> 

+-----------------------------+------------------------------------+
| Robert E. Bruccoleri, Ph.D. | email: bruc@acm.org                |
| P.O. Box 314                | URL:   http://www.congen.com/~bruc |
| Pennington, NJ 08534        |                                    |
+-----------------------------+------------------------------------+

Mon, 11 Nov 2002 14:07:13 -0500 (EST)
"Robert E. Bruccoleri" <bruc@stone.congenomics.com>
Re: Problem with 7.3 on Irix with dates before 1970