# Waiting for PostgreSQL 20 - Add backend-level lock statistics

DevFeed: [Waiting for PostgreSQL 20 - Add backend-level lock statistics](<https://devfeed.tech/articles/waiting-for-postgresql-20-add-backend-level-lock-statistics-33691.md>)

Original publisher: [Read original article](<https://www.depesz.com/2026/07/06/waiting-for-postgresql-20-add-backend-level-lock-statistics/>)

Author: depesz

Published: 2026-07-06T17:30:55Z

Content type: article

Language: en

Sources: [select \* from depesz;](<https://devfeed.tech/sources/select-from-depesz.md>)

Topics: [PostgreSQL](<https://devfeed.tech/topics/postgresql.md>), [Back end](<https://devfeed.tech/topics/backend.md>), [Statistics](<https://devfeed.tech/topics/statistics.md>)

Tags: [backend](<https://devfeed.tech/tags/backend.md>), [pg-stat-get-backend-lock](<https://devfeed.tech/tags/pg-stat-get-backend-lock.md>), [pg-stat-lock](<https://devfeed.tech/tags/pg-stat-lock.md>), [pg20](<https://devfeed.tech/tags/pg20.md>), [postgresql](<https://devfeed.tech/tags/postgresql.md>), [statistics](<https://devfeed.tech/tags/statistics.md>), [uncategorized](<https://devfeed.tech/tags/uncategorized.md>), [waiting](<https://devfeed.tech/tags/waiting.md>)

## AI overview

A walkthrough of a PostgreSQL patch that adds per-backend lock statistics, including lock wait counts, wait times, and fast-path exceeded counts. The author demonstrates the feature with concurrent psql sessions and discusses its usefulness for diagnosing lock behavior.

## Source excerpt

On 30th of June 2026, Michael Paquier committed patch: Add backend-level lock statistics This commit adds per-backend lock statistics, providing the same information as pg_stat_lock. It is now possible to retrieve those stats (lock wait counts, wait times, and fast-path exceeded count) on a per-backend basis. This data can be retrieved with a ... Continue reading "Waiting for PostgreSQL 20 - Add backend-level lock statistics"