Fixed an issue where the Database restriction is not working. Fixes #7453

This commit is contained in:
Nikhil Mohite 2022-06-09 17:03:21 +05:30 committed by Akshay Joshi
parent e1c5a06bf0
commit fd1f71587f
2 changed files with 5 additions and 3 deletions

View File

@ -19,3 +19,4 @@ Housekeeping
Bug fixes
*********
| `Issue #7411 <https://redmine.postgresql.org/issues/7411>`_ - Fixed an issue where the Database restriction is not working.

View File

@ -5,13 +5,14 @@ FROM
pg_catalog.pg_database db
LEFT OUTER JOIN pg_catalog.pg_tablespace ta ON db.dattablespace = ta.oid
WHERE {% if did %}
db.oid = {{ did|qtLiteral }}::OID{% else %}
db.oid > {{ last_system_oid }}::OID OR db.datname IN ('postgres', 'edb')
db.oid = {{ did|qtLiteral }}::OID
{% endif %}
{% if db_restrictions %}
AND
{% if did %}AND{% endif %}
db.datname in ({{db_restrictions}})
{% elif not did%}
db.oid > {{ last_system_oid }}::OID OR db.datname IN ('postgres', 'edb')
{% endif %}
{% if show_system_objects %}