Michael Fuhr <mike@xxxxxxxx> 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 ---------------------------(end of broadcast)--------------------------- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to majordomo@xxxxxxxxxxxxxx so that your message can get through to the mailing list cleanly