Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Views and materialized Views not displayed in schema page #498

Open
coorasse opened this issue Mar 11, 2025 · 0 comments
Open

Views and materialized Views not displayed in schema page #498

coorasse opened this issue Mar 11, 2025 · 0 comments

Comments

@coorasse
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant