Thread: datetime ?#!!??@

datetime ?#!!??@

From
dlibenzi@maticad.it (Davide Libenzi)
Date:
I've successfully ported PostgreSQL to HPUX 9.0.* but there is a strange
behaviour with the datetime data type.

If do do this sequence :

$ createdb mydb
[OK]

$ psqk mydb

mydb==> create table foo (ffoo datetime);
[OK]

mydb==> insert into foo values ('01/01/1998');
[OK]

mydb==> select ffoo from foo;

The rusult is a totally wrong date with year 2140.

I've tried to set datestyle but the results don't change.

Has anybody a hint for me ?

----
Davide Libenzi at :
Maticad s.r.l.
Via Della Giustizia n.9 Fano (PS) 61032 Italy
Tel.: +39-721-808308 (ra)  Fax: +39-721-808309
Email: <davidel@maticad.it>
WWW: <http://www.maticad.it>



Re: [HACKERS] datetime ?#!!??@

From
Tom Lane
Date:
dlibenzi@maticad.it (Davide Libenzi) writes:
> I've successfully ported PostgreSQL to HPUX 9.0.* but there is a strange
> behaviour with the datetime data type.
> mydb==> create table foo (ffoo datetime);
> mydb==> insert into foo values ('01/01/1998');
> mydb==> select ffoo from foo;
> The rusult is a totally wrong date with year 2140.

It works fine for me on HPUX 9.03:

play=> create table foo (ffoo datetime);
CREATE
play=> insert into foo values ('01/01/1998');
INSERT 105801 1
play=> select ffoo from foo;
ffoo
----------------------------
Thu Jan 01 00:00:00 1998 EST
(1 row)

Hmm, there are a bunch of uses of rint() in adt/dt.c.  I'll bet
your problem is that you're using the broken version of rint()
that's in HP's older releases of /lib/pa1.1/libm.a.  Have you
installed patch PHSS_4630?

You may care to consult my message "Porting notes and patches for HP-UX
9.* and 10.*" in the pgsql-patches archives for 21 Apr 1998.  This
stuff has been taken care of in the current development sources,
but if you are trying to use the 6.3.2 release you need to apply
the fixes yourself.

BTW, hackers, I intend to submit additional text for the INSTALL
directions document that warns people to get PHSS_4630 if they're
still on HPUX 9 ... if we can confirm that the primary symptom is
silly datetime results, that'll be a good thing to note in INSTALL.

            regards, tom lane

Re: [GENERAL] Re: [HACKERS] datetime ?#!!??@

From
Bruce Momjian
Date:
> You may care to consult my message "Porting notes and patches for HP-UX
> 9.* and 10.*" in the pgsql-patches archives for 21 Apr 1998.  This
> stuff has been taken care of in the current development sources,
> but if you are trying to use the 6.3.2 release you need to apply
> the fixes yourself.
>
> BTW, hackers, I intend to submit additional text for the INSTALL
> directions document that warns people to get PHSS_4630 if they're
> still on HPUX 9 ... if we can confirm that the primary symptom is
> silly datetime results, that'll be a good thing to note in INSTALL.

We need an HPUX-specific FAQ.  Period.  We have needed it for a long
time, between HPUX 9.* and 10.*, and those stars are significant.

--
Bruce Momjian                          |  830 Blythe Avenue
maillist@candle.pha.pa.us              |  Drexel Hill, Pennsylvania 19026
  +  If your life is a hard drive,     |  (610) 353-9879(w)
  +  Christ can be your backup.        |  (610) 853-3000(h)