You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Views from information_schema and pg_catalog are returned by the used query. This behavior is different to other platforms.
Expected behavior
Only user created views from the current database should be returned like done by all other platforms.
How to reproduce
With enough privileges of the connected user, the current SQL SELECT statement will return pg_catalog and information_schema views too:
SELECT quote_ident(table_name) AS viewname,
table_schema AS schemaname,
view_definition AS definition
FROM information_schema.views
WHERE view_definition IS NOT NULL
To return only user defined views, this SQL SELECT statement must be used:
SELECT quote_ident(table_name) AS viewname,
table_schema AS schemaname,
view_definition AS definition
FROM information_schema.views
WHERE view_definition IS NOT NULL AND table_schema = ANY(current_schemas(false))
Bug Report
Summary
PostgreSQL platform can return system/internal views when using SQL returned by getListViewsSQL() depending on the privileges of the connected user:
https://github.com/doctrine/dbal/blob/4.2.x/src/Platforms/PostgreSQLPlatform.php#L162-L169
Current behavior
Views from information_schema and pg_catalog are returned by the used query. This behavior is different to other platforms.
Expected behavior
Only user created views from the current database should be returned like done by all other platforms.
How to reproduce
With enough privileges of the connected user, the current SQL SELECT statement will return pg_catalog and information_schema views too:
To return only user defined views, this SQL SELECT statement must be used:
The solution is described here:
https://dba.stackexchange.com/questions/23836/how-to-list-all-views-in-sql-in-postgresql
The text was updated successfully, but these errors were encountered: