Re: What happened to the is_ family of functions proposal? - Mailing list pgsql-hackers

From Tom Lane
Subject Re: What happened to the is_ family of functions proposal?
Date
Msg-id 3790.1285084196@sss.pgh.pa.us
Whole thread Raw
In response to Re: What happened to the is_ family of functions proposal?  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: What happened to the is_ family of functions proposal?
List pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
> I think it would be useful to have a way of testing whether a cast to
> a given type will succeed.  The biggest problem with the
> exception-catching method is not that it requires writing a function
> (which, IMHO, is no big deal) but that exception handling is pretty
> slow and inefficient.  You end up doing things like... write a regexp
> to see whether the data is in approximately the right format and then
> if it is try the cast inside an exception block.  Yuck.

The problem here is that putting the exception handling in C doesn't
make things any better: it's still slow and inefficient.  And in the
general case the only way to be sure that a string will be accepted by
the input function is to try it.
        regards, tom lane


pgsql-hackers by date:

Previous
From: "Kevin Grittner"
Date:
Subject: Re: Do we need a ShmList implementation?
Next
From: Robert Haas
Date:
Subject: Re: What happened to the is_ family of functions proposal?