Re: Finding the correct type

From: Thomas Hallgren <thomas(at)tada(dot)se>
To: Martijn van Oosterhout <kleptog(at)svana(dot)org>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Finding the correct type
Date: 2006-04-30 12:28:42
Message-ID: 4454AD7A.30109@tada.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Martijn van Oosterhout wrote:
> On Sun, Apr 30, 2006 at 12:50:23PM +0200, Thomas Hallgren wrote:
>> I'm writing a UDT that takes a varchar argument that represents the name
>> of a type. The caller may optionally qualify with a namespace, i.e.
>> "pg_catalog.varchar", or "public.address". Is there a c-function
>> somewhere that will return the pg_type that corresponds to the name
>> (with respect to the current setting of search_path in case the name is
>> unqualified)?
>
> If you want it as a C string, something like format_type_be() would
> suffice. Not it's designed for use in error messages so it makes no
> particular to clean up after itself.
>
> Another possibility is the output function for the regtype type, ie
> regtypeout.
>
> Hope this helps,
Well, regtypeout led me to regtypein which in turn led me to parseTypeString which seems to
be exactly what I want.

Thanks,
Thomas Hallgren

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message mark 2006-04-30 13:10:28 Re: Is a SERIAL column a "black box", or not?
Previous Message Martijn van Oosterhout 2006-04-30 10:58:55 Re: Finding the correct type