Re: Where are user-defined types stored/viewed

From: <btober(at)seaworthysys(dot)com>
To: <dev(at)archonet(dot)com>
Cc: <btober(at)seaworthysys(dot)com>, <pgsql-general(at)postgresql(dot)org>
Subject: Re: Where are user-defined types stored/viewed
Date: 2003-09-30 12:57:47
Message-ID: 64907.216.238.112.88.1064926667.squirrel@$HOSTNAME
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


> On Monday 29 September 2003 13:35, btober(at)seaworthysys(dot)com wrote:
>> After I execute a command like
>>
>> CREATE TYPE employee_wage_journal_sum AS (supplier_pk integer,
>> employee_pk integer,
>> hourly_dollars double precision,
>> annual_dollars double precision);
>>
>> where does this definition get stored, and what query can I run to
>> get teh definition back as output?
>>
>> I don't see the new type show up anywhere in pgAdminII.
>
> In psql:
> \d emplokee_wage_journal_sum
>
> If you start psql with -E it will show you the query it uses to show
> this too.
>
> --
> Richard Huxton
> Archonet Ltd

Based on the output produced using your advice, I came up the the
following query to help me list my type definitions:

CREATE VIEW public.complex_types AS
SELECT
n.nspname,
c.relname,
a.attname,
pg_catalog.format_type(a.atttypid, a.atttypmod),
a.attnotnull,
a.atthasdef,
a.attnum,
nspacl
FROM pg_catalog.pg_class c
LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace
LEFT JOIN pg_catalog.pg_attribute a ON a.attrelid = c.relfilenode
WHERE pg_catalog.pg_table_is_visible(c.oid)
AND c.relkind = 'c'
ORDER BY
n.nspname,
c.relname,
a.attnum

~Berend Tober

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Andreas Pflug 2003-09-30 13:03:19 Re: ADD FOREIGN KEY (was Re: [GENERAL] 7.4Beta)
Previous Message Bruce Momjian 2003-09-30 12:40:03 Re: ADD FOREIGN KEY (was Re: [GENERAL] 7.4Beta)