-
Notifications
You must be signed in to change notification settings - Fork 491
Open
Description
I noticed that the schema page (/queries/schema) does not display the views and materialized views, which is a pity in my opinion.
Here is the query we use to get those in Postgres:
SELECT n.nspname AS table_schema,
c.relname AS table_name,
a.attname AS column_name,
pg_catalog.format_type(a.atttypid, a.atttypmod) AS data_type,
a.attnum AS ordinal_position,
pg_catalog.col_description(c.oid, a.attnum) AS column_comment
FROM pg_catalog.pg_attribute a
JOIN pg_catalog.pg_class c ON a.attrelid = c.oid
JOIN pg_catalog.pg_namespace n ON c.relnamespace = n.oid
WHERE c.relkind IN ('r', 'v', 'm')
AND a.attnum > 0
AND NOT a.attisdropped
AND n.nspname NOT IN ('pg_catalog', 'information_schema')
ORDER BY table_schema, table_name, ordinal_position
If you are interested @ankane , I can open a PR for the sql_adapter to run this postgres.
beporter and Sagane
Metadata
Metadata
Assignees
Labels
No labels