Re: What happened to the is_<type> family of functions proposal?

Поиск
Список
Период
Сортировка
Искать
От
Andrew Dunstan
Тема
Re: What happened to the is_<type> family of functions proposal?
Дата
Msg-id
4C9775AA.4010000@dunslane.net
Ответ на
Список
Дерево обсуждения
What happened to the is_<type> family of functions proposal? "Colin 't Hart" <colinthart@gmail.com>
Re: What happened to the is_<type> family of functions proposal? Andrew Dunstan <andrew@dunslane.net>
Re: What happened to the is_<type> family of functions proposal? "Colin 't Hart" <colinthart@gmail.com>
Re: What happened to the is_<type> family of functions proposal? Robert Haas <robertmhaas@gmail.com>
Re: What happened to the is_<type> family of functions proposal? Tom Lane <tgl@sss.pgh.pa.us>
Re: What happened to the is_<type> family of functions proposal? Robert Haas <robertmhaas@gmail.com>
Re: What happened to the is_<type> family of functions proposal? Alvaro Herrera <alvherre@commandprompt.com>
Re: What happened to the is_<type> family of functions proposal? Tom Lane <tgl@sss.pgh.pa.us>
Re: What happened to the is_<type> family of functions proposal? Alvaro Herrera <alvherre@commandprompt.com>
Re: What happened to the is_<type> family of functions proposal? Tom Lane <tgl@sss.pgh.pa.us>
Re: What happened to the is_<type> family of functions proposal? Greg Stark <gsstark@mit.edu>
Re: What happened to the is_<type> family of functions proposal? Robert Haas <robertmhaas@gmail.com>
Re: What happened to the is_<type> family of functions proposal? Tom Lane <tgl@sss.pgh.pa.us>
Re: What happened to the is_<type> family of functions proposal? Andres Freund <andres@anarazel.de>
Re: What happened to the is_<type> family of functions proposal? Tom Lane <tgl@sss.pgh.pa.us>
Re: What happened to the is_<type> family of functions proposal? Robert Haas <robertmhaas@gmail.com>
Re: What happened to the is_<type> family of functions proposal? Jeff Davis <pgsql@j-davis.com>
Re: What happened to the is_<type> family of functions proposal? Bruce Momjian <bruce@momjian.us>
Re: What happened to the is_<type> family of functions proposal? Tom Lane <tgl@sss.pgh.pa.us>
Re: What happened to the is_<type> family of functions proposal? Robert Haas <robertmhaas@gmail.com>
Re: What happened to the is_<type> family of functions proposal? Gurjeet Singh <singh.gurjeet@gmail.com>
Re: What happened to the is_<type> family of functions proposal? Tom Lane <tgl@sss.pgh.pa.us>
Re: What happened to the is_<type> family of functions proposal? Robert Haas <robertmhaas@gmail.com>
Re: What happened to the is_<type> family of functions proposal? Darren Duncan <darren@darrenduncan.net>
Re: What happened to the is_<type> family of functions proposal? Craig Ringer <craig@postnewspapers.com.au>
Re: What happened to the is_<type> family of functions proposal? Darren Duncan <darren@darrenduncan.net>


On 09/20/2010 10:29 AM, Colin 't Hart wrote:
> Hi,
>
> Back in 2002 these were proposed, what happened to them?
>
> http://archives.postgresql.org/pgsql-sql/2002-09/msg00406.php


2002 is a looooooooong time ago.

>
>
> Also I note:
>
> colin@ruby:~/workspace/eyedb$ psql
> psql (8.4.4)
> Type "help" for help.
>
> colin=> select to_date('731332', 'YYMMDD');
>   to_date
> ------------
>  1974-02-01
> (1 row)
>
> colin=>
>
>
> The fact that this wraps would seem to me to make the implementation 
> of is_date() difficult.
>
>
>

I think to_date is the wrong gadget to use here. You should probably be 
using the date input routine and trapping any data exception. e.g.:
    test_date := date_in(textout(some_text));

In plpgsql you'd put that inside a begin/exception/end block that traps 
SQLSTATE '22000' which is the class covering data exceptions.

cheers

andrew

В списке pgsql-hackers по дате отправления
От: Colin 't Hart
Дата:
От: Heikki Linnakangas
Дата:
FAQ