mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2024-11-24 09:40:21 -06:00
Fix error on the stats tab with PG10. Also, rename the 10.0_plus template directory to 10_plus to match the new versioning. Fixes #2450
This commit is contained in:
parent
8bd8ae001b
commit
49cd578816
@ -0,0 +1,51 @@
|
||||
SELECT
|
||||
pid AS "PID",
|
||||
usename AS {{ conn|qtIdent(_('User')) }},
|
||||
datname AS {{ conn|qtIdent(_('Database')) }},
|
||||
backend_start AS {{ conn|qtIdent(_('Backend start')) }},
|
||||
CASE
|
||||
WHEN client_hostname IS NOT NULL AND client_hostname != '' THEN
|
||||
client_hostname || ':' || client_port
|
||||
WHEN client_addr IS NOT NULL AND client_addr::text != '' THEN
|
||||
client_addr::text || ':' || client_port
|
||||
WHEN client_port = -1 THEN
|
||||
'local pipe'
|
||||
ELSE
|
||||
'localhost:' || client_port
|
||||
END AS {{ conn|qtIdent(_('Client')) }},
|
||||
application_name AS {{ conn|qtIdent(_('Application')) }},
|
||||
wait_event_type AS {{ conn|qtIdent(_('Wait event type')) }},
|
||||
wait_event AS {{ conn|qtIdent(_('Wait event name')) }},
|
||||
query AS {{ conn|qtIdent(_('Query')) }},
|
||||
query_start AS {{ conn|qtIdent(_('Query start')) }},
|
||||
xact_start AS {{ conn|qtIdent(_('Xact start')) }}
|
||||
FROM
|
||||
pg_stat_activity sa
|
||||
WHERE
|
||||
(SELECT r.rolsuper OR r.oid = sa.usesysid FROM pg_roles r WHERE r.rolname = current_user)
|
||||
UNION
|
||||
SELECT
|
||||
pid AS "PID",
|
||||
usename AS {{ conn|qtIdent(_('User')) }},
|
||||
'' AS {{ conn|qtIdent(_('Database')) }},
|
||||
backend_start AS {{ conn|qtIdent(_('Backend start')) }},
|
||||
CASE
|
||||
WHEN client_hostname IS NOT NULL AND client_hostname != '' THEN
|
||||
client_hostname || ':' || client_port
|
||||
WHEN client_addr IS NOT NULL AND client_addr::text != '' THEN
|
||||
client_addr::text || ':' || client_port
|
||||
WHEN client_port = -1 THEN
|
||||
'local pipe'
|
||||
ELSE
|
||||
'localhost:' || client_port
|
||||
END AS {{ conn|qtIdent(_('Client')) }},
|
||||
{{ _('Streaming Replication')|qtLiteral }} AS {{ conn|qtIdent(_('Application')) }},
|
||||
null AS {{ conn|qtIdent(_('Wait event type')) }},
|
||||
null AS {{ conn|qtIdent(_('Wait event name')) }},
|
||||
state || ' [sync (state: ' || COALESCE(sync_state, '') || ', priority: ' || sync_priority::text || ')] (' || sent_lsn || ' sent, ' || write_lsn || ' written, ' || flush_lsn || ' flushed, ' || replay_lsn || ' applied)' AS {{ conn|qtIdent(_('Query')) }},
|
||||
null AS {{ conn|qtIdent(_('Query start')) }},
|
||||
null AS {{ conn|qtIdent(_('Xact start')) }}
|
||||
FROM
|
||||
pg_stat_replication sa
|
||||
WHERE
|
||||
(SELECT r.rolsuper OR r.oid = sa.usesysid FROM pg_roles r WHERE r.rolname = current_user)
|
@ -16,7 +16,7 @@ class VersionedTemplateLoader(DispatchingJinjaLoader):
|
||||
template_path_parts = template.split("#", 2)
|
||||
|
||||
server_versions = (
|
||||
{'name': "10.0_plus", 'number': 100000},
|
||||
{'name': "10_plus", 'number': 100000},
|
||||
{'name': "9.6_plus", 'number': 90600},
|
||||
{'name': "9.5_plus", 'number': 90500},
|
||||
{'name': "9.4_plus", 'number': 90400},
|
||||
|
Loading…
Reference in New Issue
Block a user