mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
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:
committed by
Dave Page
parent
fb02f8b1be
commit
ce1c06d7f1
@@ -219,25 +219,10 @@ def check_precondition(f):
|
||||
" to view the graph.")
|
||||
)
|
||||
|
||||
g.conn = g.manager.connection()
|
||||
|
||||
# If 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 server"
|
||||
" to view the table.")
|
||||
)
|
||||
else:
|
||||
return precondition_required(
|
||||
gettext("Please connect to the selected server"
|
||||
" to view the graph.")
|
||||
)
|
||||
|
||||
if 'did' in kwargs:
|
||||
db_conn = g.manager.connection(did=kwargs['did'])
|
||||
g.conn = g.manager.connection(did=kwargs['did'])
|
||||
# If the selected DB not connected then return error to browser
|
||||
if not db_conn.connected():
|
||||
if not g.conn.connected():
|
||||
if f.__name__ in stats_type:
|
||||
return precondition_required(
|
||||
gettext("Please connect to the selected database"
|
||||
@@ -248,6 +233,21 @@ def check_precondition(f):
|
||||
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
|
||||
if not g.conn.connected():
|
||||
if f.__name__ in stats_type:
|
||||
return precondition_required(
|
||||
gettext("Please connect to the selected server"
|
||||
" to view the table.")
|
||||
)
|
||||
else:
|
||||
return precondition_required(
|
||||
gettext("Please connect to the selected server"
|
||||
" to view the graph.")
|
||||
)
|
||||
|
||||
# Set template path for sql scripts
|
||||
g.server_type = g.manager.server_type
|
||||
|
||||
Reference in New Issue
Block a user