Lost a function overloading capability in v6.3

Поиск
Список
Период
Сортировка
От Thomas G. Lockhart
Тема Lost a function overloading capability in v6.3
Дата
Msg-id 34FC0B9A.5F645148@alumni.caltech.edu
обсуждение исходный текст
Ответы Re: [HACKERS] Lost a function overloading capability in v6.3  (Michael Meskes <meskes@topsystem.de>)
Список 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 по дате отправления:

Предыдущее
От: Zeugswetter Andreas SARZ
Дата:
Сообщение: text should be a blob field
Следующее
От: Michael Meskes
Дата:
Сообщение: Re: [HACKERS] Lost a function overloading capability in v6.3