Lost a function overloading capability in v6.3 - Mailing list pgsql-hackers

From Thomas G. Lockhart
Subject Lost a function overloading capability in v6.3
Date
Msg-id 34FC0B9A.5F645148@alumni.caltech.edu
Whole thread Raw
Responses Re: [HACKERS] Lost a function overloading capability in v6.3  (Michael Meskes <meskes@topsystem.de>)
List pgsql-hackers
I had developed a "cheat" to help people convert Unix system time stored
as an integer into a true date/time type. I noticed that it did not work
prior to the v6.3 release, but have now gone back to v6.2.1 and
confirmed that it works there. Can someone test this on their
installation and confirm that it is a problem for all v6.3 (since
someone reported that it worked for them earlier, but I'm not sure how
that could be):

  CREATE FUNCTION abstime_datetime(int4)
  RETURNS datetime
  AS '-' LANGUAGE 'internal';

For v6.2.1, here is the result:

postgres=> select abstime_datetime(0);
abstime_datetime
----------------
epoch
(1 row)
postgres=> select abstime_datetime(900000000);
abstime_datetime
----------------------------
Thu Jul 09 16:00:00 1998 GMT
(1 row)

When I run this same thing on v6.3, I get a date sometime in 1974 which
I think might actually be derived from a pointer interpreted as an
integer :(

postgres=> select abstime_datetime(0);
abstime_datetime
----------------------------
Wed Apr 24 18:51:28 1974 GMT
(1 row)
postgres=> select abstime_datetime(900000000);
abstime_datetime
----------------------------
Wed Apr 24 18:37:12 1974 GMT
(1 row)

Any ideas where to look? It would be a shame to lose this capability.
Although the example is perhaps not too respectable, it illustrates a
useful feature...

                                                                       -
Tom


pgsql-hackers by date:

Previous
From: Zeugswetter Andreas SARZ
Date:
Subject: text should be a blob field
Next
From: Michael Meskes
Date:
Subject: Re: [HACKERS] Lost a function overloading capability in v6.3