IsDate function in plpgsql

Поиск
Список
Период
Сортировка
От Sistemas C.M.P.
Тема IsDate function in plpgsql
Дата
Msg-id 006501c66a07$b8c08d60$0501a8c0@pcsistemas
обсуждение исходный текст
Ответы Re: IsDate function in plpgsql
Re: IsDate function in plpgsql
Список pgsql-admin
A few days ago, someone in this list gives  me a function (plpgsql) that evaluates if a string is a valid date or not.
It returns 1 or 0 (valid/Not Valid)
The problem is that if the argument is a NULL field the function returns 1.
I don't have experience with plpgsql language.
This is the function
 
begin
  perform $1::date;
  return 1;
exception when others then
  return 0;
end

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

Предыдущее
От: Giancarlo Rubio
Дата:
Сообщение:
Следующее
От: Ketema Harris
Дата:
Сообщение: Re: IsDate function in plpgsql