table-name(mapv:table_name(jdbc/result-set-seq(.getTablesmetadatanilschema"%"(into-arrayString["TABLE","VIEW","FOREIGN TABLE"]))))]; tablePattern "%" = match all tables
["SELECT schemaname AS \"schema\", matviewname AS \"name\" FROM pg_matviews;"]))
(catchThrowablee
(log/error"Failed to fetch materialized views for this database:"(.getMessagee)))))
(defn-describe-database
"Custom implementation of `describe-database` for Postgres.
Postgres Materialized Views are not returned by normal JDBC methods: see [issue #2355](https://github.com/metabase/metabase/issues/2355); we have to manually fetch them.
This implementation combines the results from the generic SQL default implementation with materialized views fetched from `materialized-views`."