Re: How to list domains

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Alexander Cohen <alex(at)toomuchspace(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: How to list domains
Date: 2004-04-08 01:38:13
Message-ID: 6843.1081388293@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Mage 2004-04-08 01:46:25 eval in plpgsl
Previous Message Tom Lane 2004-04-08 01:29:06 Re: ERROR: invalid memory alloc request size 0