-
Notifications
You must be signed in to change notification settings - Fork 12.4k
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
Postgres - Materialized Views are not handled like tables #27017
Comments
While looking in to this I noticed that this discovery query and it´s findings doesn't seem to get logged to the log file even when:
Not sure if that can be considered a bug, but I expected that to be part of the output. |
MView information is stored in a different system table, so the current implemention doesn't offer suggestions. A union query is performed to get all tables plus mviews. This PR adds table 'type' property to the ctrl target to identify MVIEW from TABLE. This allows us to use the correct system tables to get column information. resolves: grafana#27017
I will close this as it has been fixed by this |
Hello - while testing in grafana 9.5.13, I can see that regular views are indeed visible, but postgres materialized views are not visible. Is that expected? |
What happened:
Postgres materialized views don't show up as selectable tables and neither does their columns when setting up a panel.
Inputting the names of the tables and columns manually does work
What you expected to happen:
I expected that when setting up a new panel, when in the query definition tab that the "From" field should be populated with "new_mview" and the the columns "timestamp" and "valueColoumn" should be populated as possible columns to select.
How to reproduce it (as minimally and precisely as possible):
This is my sample definition for a materialized view that I expected Grafana to find:
Anything else we need to know?:
I looked at the discovering query that Grafana sends to the DB-server:
This query seems to be built by: meta_query.ts
This returns normal tables and "normal views" but not materialized views. To query postgres for the materialized views you can use the query:
select * from pg_matviews;
I raised a forum post about the problem here: https://community.grafana.com/t/postgres-materialized-view-autocomplete/35081
Environment:
The text was updated successfully, but these errors were encountered: