postgresql7.1
SELECT pg_catalog.format_type(t.oid, NULL) AS type1,
pg_catalog.format_type(t.oid, NULL) AS type2
FROM pg_catalog.pg_type t
LEFT JOIN pg_catalog.pg_namespace n ON n.oid = t.typnamespace
WHERE (t.typrelid = 0 OR (SELECT c.relkind = 'c' FROM
pg_catalog.pg_class c
WHERE c.oid = t.typrelid)) AND t.typname !~ '^_'
AND pg_catalog.pg_type_is_visible(t.oid)
AND n.nspname = 'pg_catalog'
ORDER BY pg_catalog.format_type(t.oid, NULL);
SELECT t.typname AS name1, t.typname AS name2
FROM pg_catalog.pg_type t
LEFT JOIN pg_catalog.pg_namespace n ON n.oid = t.typnamespace
WHERE t.typtype = 'd'
AND pg_catalog.pg_type_is_visible(t.oid)
ORDER BY t.typname;