{% load i18n %}

๐Ÿ”’ {% trans "Locks" %}

pg_locks {% trans "โ€” sessions waiting on a lock and who holds it" %}

{% include "partials/_banner.html" %} {% if trees %}
{% for t in trees %}
{% for n in t.nodes %}
{% if n.depth > 0 %}โ†ณ{% endif %} {% if n.depth == 0 %} {% trans "head blocker" %} PID {{ n.pid }} {% else %} {% trans "blocked" %} PID {{ n.pid }} {% endif %} {{ n.user|default:"โ€”" }} {% if n.in_cycle %} {% trans "cycle" %} {% endif %} {% if n.state == 'idle in transaction' %} {% trans "idle in txn" %} {% elif n.state %} {{ n.state }} {% endif %} {% if n.wait_secs is not None %}{% blocktrans with secs=n.wait_secs %}waiting {{ secs }}s{% endblocktrans %}{% endif %} {% if n.lock_mode %} {{ n.lock_mode }} {% trans "on" %} {{ n.object }} {% endif %} {% if n.depth == 0 and t.blocked_count %} {% blocktrans count c=t.blocked_count %}blocking {{ c }} session{% plural %}blocking {{ c }} sessions{% endblocktrans %} {% endif %}
{{ n.query|default:"โ€”" }}
{% if n.cancellable %} {% else %} {# Not running a query: cancel would be accepted and do nothing. #} {% trans "cancel" %} {% endif %}
{% endfor %}
{% endfor %}

{% blocktrans count n=blocked_total %}{{ n }} blocked session ยท end the head blocker at the top of a chain to free everything beneath it โ€” cancel stops its query, kill ends its transaction{% plural %}{{ n }} blocked sessions ยท end the head blocker at the top of a chain to free everything beneath it โ€” cancel stops its query, kill ends its transaction{% endblocktrans %}

{% else %}

{% trans "No lock waits" %}

{% trans "Nothing is blocked on a lock right now." %}

{% endif %}

{% trans "The query behind this view" %}

{{ query_sql }}