Suggestion: Need conversion-testing functions.

Поиск
Список
Период
Сортировка
От Josh Berkus
Тема Suggestion: Need conversion-testing functions.
Дата
Msg-id 200304181407.33083.josh@agliodbs.com
обсуждение исходный текст
Список pgsql-sql
Folks,

A current issue that I am struggling with is that there is no way to test
whether a data type can be cast within a PL/pgSQL function.   If, for
example, I want to test whether a string can be cast into a timestamp, I
cannot do it without raising  an exception, which will then abort my
function.

One would think that isfinite() would allow testing of dates in this way, but
isfinite() returns an exception instead of False if the value passed is an
invalid date.   This makes isfinite(), IMHO, completely useless as a function
-- it doesn't do anything CAST( AS DATE) wouldn't do.

We need "testing functions" for, at a minimum:
text --> date
text --> timestamp
text --> ip address
text --> interval
text --> integer

While I am happy to pay someone to do the necessary coding, I feel strongly
that once these functions are built they should be included in the main set
of builtins.

Comments?  Volunteers?

--
-Josh BerkusAglio Database SolutionsSan Francisco



В списке pgsql-sql по дате отправления:

Предыдущее
От: "Yudie"
Дата:
Сообщение: How to retrieve object definition?
Следующее
От: Josh Berkus
Дата:
Сообщение: Truly bizarre behavior with VACUUM FULL?