1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-28 23:42:10 +03:00

Add composite-type attributes to information_schema.element_types view

This commit is contained in:
Peter Eisentraut
2011-06-28 16:07:23 +03:00
parent c533c1477f
commit 5594d14696
2 changed files with 10 additions and 7 deletions

View File

@ -2467,12 +2467,13 @@ CREATE VIEW element_types AS
FROM pg_namespace n, pg_type at, pg_namespace nbt, pg_type bt,
(
/* columns */
/* columns, attributes */
SELECT c.relnamespace, CAST(c.relname AS sql_identifier),
'TABLE'::text, a.attnum, a.atttypid
CASE WHEN c.relkind = 'c' THEN 'USER-DEFINED TYPE'::text ELSE 'TABLE'::text END,
a.attnum, a.atttypid
FROM pg_class c, pg_attribute a
WHERE c.oid = a.attrelid
AND c.relkind IN ('r', 'v', 'f')
AND c.relkind IN ('r', 'v', 'f', 'c')
AND attnum > 0 AND NOT attisdropped
UNION ALL