test datatype for ANY - Mailing list pgsql-general

From NosyMan
Subject test datatype for ANY
Date
Msg-id 200502112040.53939.nosyman@gmail.com
Whole thread Raw
Responses Re: test datatype for ANY
List 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


pgsql-general by date:

Previous
From: Mark Harrison
Date:
Subject: size in bytes of a table?
Next
From: Michael Fuhr
Date:
Subject: Re: size in bytes of a table?