Skip site navigation (1) Skip section navigation (2)

Re: determining a type oid from the name

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Thom Brown <thom(at)linux(dot)com>
Cc: Kevin Grittner <Kevin(dot)Grittner(at)wicourts(dot)gov>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: determining a type oid from the name
Date: 2012-02-22 19:14:10
Message-ID: 4F453E82.1060005@dunslane.net (view raw or flat)
Thread:
Lists: pgsql-hackers

On 02/22/2012 01:36 PM, Thom Brown wrote:
> On 22 February 2012 18:34, Kevin Grittner<Kevin(dot)Grittner(at)wicourts(dot)gov>  wrote:
>> Thom Brown<thom(at)linux(dot)com>  wrote:
>>> Does this help?
>>>
>>> test=# SELECT pg_typeof('4834.34'::numeric)::oid;
>>>   pg_typeof
>>> -----------
>>>        1700
>>> (1 row)
>> Wouldn't it be easier to do this instead?
>>
>> test=# SELECT 'numeric'::regtype::oid;
>>   oid
>> ------
>>   1700
>> (1 row)
> Well I may have misread the problem. I thought it was that for a
> particular data value, the oid of the type of that value was needed.


Maybe I need to be more clear. The C code I'm writing will process 
composites. I want to cache the Oids of certain non-builtin types in the 
function info's fn_extra, and then be able to test whether or not the 
fields in the composites are of those types.

cheers

andrew

In response to

Responses

pgsql-hackers by date

Next:From: Simon RiggsDate: 2012-02-22 19:23:10
Subject: Re: VACUUM ANALYZE is faster than ANALYZE?
Previous:From: Pavel StehuleDate: 2012-02-22 19:12:35
Subject: Re: VACUUM ANALYZE is faster than ANALYZE?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group