Re: How to list domains - Mailing list pgsql-general

From Tom Lane
Subject Re: How to list domains
Date
Msg-id 6843.1081388293@sss.pgh.pa.us
Whole thread Raw
In response to Re: How to list domains  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-general
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> They are SQL-standard names for our int4, float8 types.  They map
> internally to those types.  I don't know a way to list separately.

You can use format_type() to get the canonical per-spec form.  For instance

regression=# select typname, format_type(oid,-1) from pg_type where oid in (1043,23);
 typname |    format_type
---------+-------------------
 varchar | character varying
 int4    | integer
(2 rows)

I don't know of any way to get a listing of secondary aliases that the
parser will recognize (such as "int" for int4).  They're hardwired into
the grammar rather than being table entries anywhere.  Fortunately,
there are not all that many beyond the typname and the format_type forms.

            regards, tom lane

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: ERROR: invalid memory alloc request size 0
Next
From: Tom Lane
Date:
Subject: Re: Cursors and Transactions, why?