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

@@ -35,3 +35,4 @@ Bug fixes
| `Issue #7460 <https://redmine.postgresql.org/issues/7460>`_ - Fixed an issue where pgAdmin stuck while creating a new index.
| `Issue #7461 <https://redmine.postgresql.org/issues/7461>`_ - Fixed an issue where the connection wasn't being closed when the user switched to a new connection and closed the query tool.
| `Issue #7468 <https://redmine.postgresql.org/issues/7468>`_ - Skip the history records if the JSON info can't be parsed instead of showing 'No history'.
| `Issue #7502 <https://redmine.postgresql.org/issues/7502>`_ - Fixed an issue where an error message is displayed when creating the new database.

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;