Re: List of User Defined Types?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Siddharth Saha <siddharthsaha(at)drishti-soft(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: List of User Defined Types?
Date: 2010-09-17 13:57:06
Message-ID: 9914.1284731826@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Siddharth Saha <siddharthsaha(at)drishti-soft(dot)com> writes:
> How can you determine the number of user defined types. Does the pg_type
> table has some entry which indicates that it is a user defined type and not
> a pre-defined one?

There isn't any hard and fast distinction betweem built-in and
user-defined types.

Depending on what you're doing, you might want to consider a type
"built-in" if it resides in the pg_catalog or information_schema
schemas (I think this is the definition psql's \dT uses). Or you
could check whether the type's OID is less than 16384, which would
tell you whether it was created during initdb.

regards, tom lane

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Josh Kupershmidt 2010-09-17 14:56:50 Re: Unable to use VIEWS (Ok button remains shaded)
Previous Message Jean-Yves F. Barbier 2010-09-17 11:33:05 Re: Adding seconds to a time