Fixed an issue where an error message is displayed when creating the new database. Fixes #7502

This commit is contained in:
Nikhil Mohite
2022-06-24 15:09:48 +05:30
committed by Akshay Joshi
parent 23869cd61f
commit 837e3e5e83
4 changed files with 25 additions and 16 deletions

View File

@@ -25,14 +25,18 @@ WHERE
db.datistemplate = {{show_user_defined_templates}} AND
{% endif %}
{% if did %}
db.oid = {{ did|qtLiteral }}::OID
db.oid = {{ did|qtLiteral }}::OID
{% else %}
{% if name %}
db.datname = {{ name|qtLiteral }}::text
{% endif %}
{% endif %}
{% if db_restrictions %}
{% if did %}AND{% endif %}
db.datname in ({{db_restrictions}})
{% elif not did%}
db.oid > {{ last_system_oid }}::OID OR db.datname IN ('postgres', 'edb')
{% if db_restrictions %}
{% if did or name %}AND{% endif %}
db.datname in ({{db_restrictions}})
{% elif not did and not name%}
db.oid > {{ last_system_oid }}::OID OR db.datname IN ('postgres', 'edb')
{% endif %}
ORDER BY datname;

View File

@@ -36,17 +36,20 @@ FROM pg_catalog.pg_database db
LEFT OUTER JOIN pg_catalog.pg_shdescription descr ON (
db.oid=descr.objoid AND descr.classoid='pg_database'::regclass
)
WHERE {% if did %}
db.oid = {{ did|qtLiteral }}::OID
WHERE
{% if did %}
db.oid = {{ did|qtLiteral }}::OID
{% else %}
{% if name %}
db.datname = {{ name|qtLiteral }}::text
{% endif %}
{% endif %}
{% if db_restrictions %}
{% if did %}AND{% endif %}
db.datname in ({{db_restrictions}})
{% elif not did%}
db.oid > {{ last_system_oid }}::OID OR db.datname IN ('postgres', 'edb')
{% if did or name %}AND{% endif %}
db.datname in ({{db_restrictions}})
{% elif not did and not name%}
db.oid > {{ last_system_oid }}::OID OR db.datname IN ('postgres', 'edb')
{% endif %}
AND db.datistemplate in (false, {{show_system_objects}})
ORDER BY datname;

View File

@@ -13,7 +13,8 @@ db.oid = {{ did|qtLiteral }}::OID
{% if did %}AND{% endif %}
db.datname in ({{db_restrictions}})
{% elif not did%}
db.oid > {{ last_system_oid }}::OID OR db.datname IN ('postgres', 'edb')
{% if db_restrictions %} AND {%endif%}
db.oid > {{ last_system_oid }}::OID OR db.datname IN ('postgres', 'edb')
{% endif %}
ORDER BY datname;