Re: Getting the type Oid in a CREATE TYPE output function .. - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Getting the type Oid in a CREATE TYPE output function ..
Date
Msg-id 11252.1160670403@sss.pgh.pa.us
Whole thread Raw
In response to Getting the type Oid in a CREATE TYPE output function ..  (Weslee Bilodeau <weslee.bilodeau@hypermediasystems.com>)
Responses Re: Getting the type Oid in a CREATE TYPE output function  (Weslee Bilodeau <weslee.bilodeau@hypermediasystems.com>)
List pgsql-hackers
Weslee Bilodeau <weslee.bilodeau@hypermediasystems.com> writes:
> I'm trying to create a few new types, and based on the type in/out
> functions will operate a bit differently.
> For the input function finding the type Oid is easy -
>   Oid our_type_oid = PG_GETARG_OID(1);
> For output though I'm having difficulty finding out the type Oid.

You can't, and if you could, relying on it would be a security hole
in your function (somebody could invoke the function manually and pass
it a false OID value).  You have to put everything you need to know
right into the Datum.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Josh Berkus
Date:
Subject: Re: Hints WAS: Index Tuning Features
Next
From: Csaba Nagy
Date:
Subject: Re: [PERFORM] Hints proposal