Ensure we display the relation name (and not the OID) in the locks table wherever possible. Fixes #3702

Note that at the server level we fetch the data from pg_locks in the maintenance database,
so it can not fetch the pg_class relation for tables in other databasess (relation::regclass).
This commit is contained in:
Khushboo Vashi 2019-01-04 14:45:28 +00:00 committed by Dave Page
parent fb02f8b1be
commit ce1c06d7f1
2 changed files with 18 additions and 17 deletions

View File

@ -25,6 +25,7 @@ Bug fixes
| `Bug #3599 <https://redmine.postgresql.org/issues/3599>`_ - Run Postfix in the container build so passwords can be reset etc.
| `Bug #3619 <https://redmine.postgresql.org/issues/3619>`_ - Add titles to the code areas of the Query Tool and Debugger to ensure that panels can be re-docked within them.
| `Bug #3679 <https://redmine.postgresql.org/issues/3679>`_ - Fix a webpack issue that could cause the Query Tool to fail to render.
| `Bug #3702 <https://redmine.postgresql.org/issues/3702>`_ - Ensure we display the relation name (and not the OID) in the locks table wherever possible.
| `Bug #3711 <https://redmine.postgresql.org/issues/3711>`_ - Fix an encoding issue in the query tool.
| `Bug #3726 <https://redmine.postgresql.org/issues/3726>`_ - Include the WHERE clause on EXCLUDE constraints in RE-SQL.
| `Bug #3753 <https://redmine.postgresql.org/issues/3753>`_ - Fix an issue when user define Cast from smallint->text is created.

View File

@ -219,6 +219,21 @@ def check_precondition(f):
" to view the graph.")
)
if 'did' in kwargs:
g.conn = g.manager.connection(did=kwargs['did'])
# If the selected DB not connected then return error to browser
if not g.conn.connected():
if f.__name__ in stats_type:
return precondition_required(
gettext("Please connect to the selected database"
" to view the table.")
)
else:
return precondition_required(
gettext("Please connect to the selected database to"
" view the graph.")
)
else:
g.conn = g.manager.connection()
# If DB not connected then return error to browser
@ -234,21 +249,6 @@ def check_precondition(f):
" to view the graph.")
)
if 'did' in kwargs:
db_conn = g.manager.connection(did=kwargs['did'])
# If the selected DB not connected then return error to browser
if not db_conn.connected():
if f.__name__ in stats_type:
return precondition_required(
gettext("Please connect to the selected database"
" to view the table.")
)
else:
return precondition_required(
gettext("Please connect to the selected database to"
" view the graph.")
)
# Set template path for sql scripts
g.server_type = g.manager.server_type
g.version = g.manager.version