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

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

Reply via email to