Postgres не имеет никакого инструмента для контроля времени блокировки. Для этого у нас был патч к Postgres. Во всяком случае - pg_tables
это не таблица - это представление
postgres=# \d+ pg_tables;
View "pg_catalog.pg_tables"
+-------------+---------+-----------+----------+---------+---------+-------------+
| Column | Type | Collation | Nullable | Default | Storage | Description |
+-------------+---------+-----------+----------+---------+---------+-------------+
| schemaname | name | | | | plain | |
| tablename | name | | | | plain | |
| tableowner | name | | | | plain | |
| tablespace | name | | | | plain | |
| hasindexes | boolean | | | | plain | |
| hasrules | boolean | | | | plain | |
| hastriggers | boolean | | | | plain | |
| rowsecurity | boolean | | | | plain | |
+-------------+---------+-----------+----------+---------+---------+-------------+
View definition:
SELECT n.nspname AS schemaname,
c.relname AS tablename,
pg_get_userbyid(c.relowner) AS tableowner,
t.spcname AS tablespace,
c.relhasindex AS hasindexes,
c.relhasrules AS hasrules,
c.relhastriggers AS hastriggers,
c.relrowsecurity AS rowsecurity
FROM pg_class c
LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
LEFT JOIN pg_tablespace t ON tpostgres=# \d+ pg_tables;
View "pg_catalog.pg_tables"
+-------------+---------+-----------+----------+---------+---------+-------------+
| Column | Type | Collation | Nullable | Default | Storage | Description |
+-------------+---------+-----------+----------+---------+---------+-------------+
| schemaname | name | | | | plain | |
| tablename | name | | | | plain | |
| tableowner | name | | | | plain | |
| tablespace | name | | | | plain | |
| hasindexes | boolean | | | | plain | |
| hasrules | boolean | | | | plain | |
| hastriggers | boolean | | | | plain | |
| rowsecurity | boolean | | | | plain | |
+-------------+---------+-----------+----------+---------+---------+-------------+
View definition:
SELECT n.nspname AS schemaname,
c.relname AS tablename,
pg_get_userbyid(c.relowner) AS tableowner,
t.spcname AS tablespace,
c.relhasindex AS hasindexes,
c.relhasrules AS hasrules,
c.relhastriggers AS hastriggers,
c.relrowsecurity AS rowsecurity
FROM pg_class c
LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
LEFT JOIN pg_tablespace t ON t.oid = c.reltablespace
WHERE c.relkind = ANY (ARRAY['r'::"char", 'p'::"char"]);
.oid = c.reltablespace
WHERE c.relkind = ANY (ARRAY['r'::"char", 'p'::"char"]);
Вы можете проверить, не заблокирована ли одна или несколько из этих таблиц - должно быть только несколько операций, которые могут заблокировать эти таблицы от чтения. Больше документации об этом https://wiki.postgresql.org/wiki/Lock_Monitoring