Re: getting type name

From: Tzahi Fadida <Tzahi(dot)ML(at)gmail(dot)com>
To: Michael Fuhr <mike(at)fuhr(dot)org>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: getting type name
Date: 2006-07-09 19:08:42
Message-ID: 200607092208.42900.Tzahi.ML@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sunday 09 July 2006 21:49, Michael Fuhr wrote:
> On Sun, Jul 09, 2006 at 09:03:21PM +0300, Tzahi Fadida wrote:
> > How do i get a char * type from a type Oid. i.e.
> > getStringTypeFromOid(INT4OID) will return "int4".
>
> Server-side or client-side? In the backend I think you could use

Backend.

> format_type_be() or format_type_with_typemod(), both declared in
> utils/builtins.h and defined in src/backend/utils/adt/format_type.c.

They return format_type_be(INT4OID) = "integer" or format_type_be(FLOAT8OID)
= "double precision"
I need to use this in a query with the "::" cast operator.
There is a function SPI_gettype but it works on relations. I wish to work
directly with the oid types without opening a relation.

10x.

--
Regards,
        Tzahi.
--
Tzahi Fadida
Blog: http://tzahi.blogsite.org | Home Site: http://tzahi.webhop.info
WARNING TO SPAMMERS:  see at
http://members.lycos.co.uk/my2nis/spamwarning.html

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Martijn van Oosterhout 2006-07-09 21:29:29 Re: getting type name
Previous Message Michael Fuhr 2006-07-09 18:49:53 Re: getting type name