test datatype for ANY

From: NosyMan <nosyman(at)gmail(dot)com>
To: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: test datatype for ANY
Date: 2005-02-11 20:40:53
Message-ID: 200502112040.53939.nosyman@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi there,

How can I test the type of a parameter passed to a function via ANY data type?
I want something like this:

CREATE OR REPLACE FUNCTION myfunction(_param ANY) RETURNS INTEGER AS $$
BEGIN
IF "_param IS OF INTEGER TYPE" THEN
-- do something with INTEGER
END IF;
IF "param is of BOOLEAN TYPE" THEN
-- do something with BOOLEAN
END IF;
RETURN;
END;
$$ LANGUAGE plpgsql;

Thanks,
Nosy

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Cristian Prieto 2005-02-11 20:56:09 Hello...
Previous Message Tom Lane 2005-02-11 20:37:01 Re: test datatype for ANY