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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Weslee Bilodeau <weslee(dot)bilodeau(at)hypermediasystems(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Getting the type Oid in a CREATE TYPE output function ..
Date: 2006-10-12 16:26:43
Message-ID: 11252.1160670403@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Weslee Bilodeau <weslee(dot)bilodeau(at)hypermediasystems(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Csaba Nagy 2006-10-12 16:34:25 Re: Hints proposal
Previous Message Josh Berkus 2006-10-12 16:25:38 Re: Hints WAS: Index Tuning Features