Re: test datatype for ANY
| От | Tom Lane |
|---|---|
| Тема | Re: test datatype for ANY |
| Дата | |
| Msg-id | 12939.1108150351@sss.pgh.pa.us обсуждение |
| Ответ на | Re: test datatype for ANY (Michael Fuhr <mike@fuhr.org>) |
| Ответы |
Re: test datatype for ANY
|
| Список | pgsql-general |
Michael Fuhr <mike@fuhr.org> writes:
> On Fri, Feb 11, 2005 at 08:40:53PM +0000, NosyMan wrote:
>> I want something like this:
>>
>> CREATE OR REPLACE FUNCTION myfunction(_param ANY) RETURNS INTEGER AS $$
> PostgreSQL has an undocumented IS OF construct:
... which won't help since IS OF is a parse-time test, and he needs a
run-time one. However, he'll never get that far anyway since plpgsql
doesn't allow ANY parameters. AFAIK the *only* way you could write such
a function is in C (using get_fn_expr_argtype()).
There are some limited cases you could handle in plpgsql using the
polymorphic-functions stuff (ie, ANYELEMENT not ANY) but it still has
no concept of a run-time type test.
regards, tom lane
В списке pgsql-general по дате отправления: