Re: Getting the type Oid in a CREATE TYPE output function ..

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Getting the type Oid in a CREATE TYPE output function ..
Дата
Msg-id 11252.1160670403@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Getting the type Oid in a CREATE TYPE output function ..  (Weslee Bilodeau <weslee.bilodeau@hypermediasystems.com>)
Ответы Re: Getting the type Oid in a CREATE TYPE output function  (Weslee Bilodeau <weslee.bilodeau@hypermediasystems.com>)
Список 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 по дате отправления:

Предыдущее
От: Josh Berkus
Дата:
Сообщение: Re: Hints WAS: Index Tuning Features
Следующее
От: Csaba Nagy
Дата:
Сообщение: Re: [PERFORM] Hints proposal