question about information_schema

Started by Dave Cramerover 21 years ago3 messages
#1Dave Cramer
pg@fastcrypt.com

I'm trying to implement getUDT for the jdbc driver.

It requires the basetype of a type.

If I do create type testint8 as (i int8) and then select typbasetype
from pg_type where typname='testint8' the value is 0?

While I'm asking how can I find all of the user defined types, assuming
that the user is the owner of the cluster. I see that pg_dump can do
this ?

--
Dave Cramer
519 939 0336
ICQ # 14675561

#2Kris Jurka
books@ejurka.com
In reply to: Dave Cramer (#1)
Re: question about information_schema

On Tue, 18 May 2004, Dave Cramer wrote:

If I do create type testint8 as (i int8) and then select typbasetype
from pg_type where typname='testint8' the value is 0?

You've created a complex type here, not a domain. See typtype and
typrelid for this case.

create domain testint8 as int8; will do what you were expecting.

Kris Jurka

#3Tom Lane
tgl@sss.pgh.pa.us
In reply to: Dave Cramer (#1)
Re: question about information_schema

Dave Cramer <pg@fastcrypt.com> writes:

While I'm asking how can I find all of the user defined types, assuming
that the user is the owner of the cluster. I see that pg_dump can do
this ?

IIRC, what pg_dump actually does is look for types that are not in the
pg_catalog schema. Plus you probably want to exclude composite types
other than "standalone" ones (ie, all those whose associated pg_class
entry has a relkind other than COMPOSITE_TYPE).

regards, tom lane