Re: Get data type aliases

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Rebecca Clarke <r(dot)clarke83(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Get data type aliases
Date: 2013-06-12 19:31:09
Message-ID: 20130612193109.GH5491@eldon.alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Rebecca Clarke escribió:
> Hi all.
>
> I have a function that has an attribute with datatype of character varying.
> In the pg_type table the oid of the data type points to type varchar
>
> Is there somewhere that identifies the alias for each type?

Cast the type name to regtype. That outputs the "official" name.

alvherre=# select 'int'::regtype;
regtype
---------
integer
(1 fila)

--
Álvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2013-06-12 20:07:54 Re: Pass-by-reference UDTs and volatility
Previous Message Stephen Scheck 2013-06-12 18:48:27 Pass-by-reference UDTs and volatility