Различия
Показаны различия между двумя версиями страницы.
— | pg_locks [2021/07/31 21:58] (текущий) – создано - внешнее изменение 127.0.0.1 | ||
---|---|---|---|
Строка 1: | Строка 1: | ||
+ | ====== pg_locks блокировки в PostgreSQL ====== | ||
+ | {{htmlmetatags> | ||
+ | metatag-description=(Представление pg_locks даёт доступ к информации о блокировках, | ||
+ | }} | ||
+ | |||
+ | * [[http:// | ||
+ | * [[PostgreSQL]] | ||
+ | * [[postgresql# | ||
+ | |||
+ | Представление (VIEW) pg_locks содержит подробную информацию о блокировках в базе данных. Список текущих блокировок с указанием типа блокировки, | ||
+ | |||
+ | Один из распространенных случаев, | ||
+ | select l.database, d.datname, l.relation, c.relname, | ||
+ | l.locktype, | ||
+ | l.virtualxid, | ||
+ | l.pid, l.mode, l.granted, | ||
+ | c.relacl | ||
+ | from pg_locks as l | ||
+ | LEFT JOIN pg_database AS d ON l.database= d.oid | ||
+ | LEFT JOIN pg_class AS c ON l.relation = c.oid | ||
+ | order by c.relname; | ||
+ | </ | ||
+ | select pg_class.relname, | ||
+ | pg_locks.virtualtransaction, | ||
+ | from pg_class, | ||
+ | where pg_class.relfilenode = pg_locks.relation | ||
+ | order by pg_class.relname; | ||
+ | </ | ||
+ | ====== Запросы ====== | ||
+ | ^^Name^Type^References^Description^^^^ | ||
+ | ||locktype|text| |type of the lockable object: relation, extend, page, tuple, transactionid, | ||
+ | ||database|oid|pg_database.oid|OID of the database in which the object exists, or zero if the object is a shared object, or NULL if the object is a transaction ID|OID базы данных, | ||
+ | ||relation|oid|pg_class.oid|OID of the relation, or NULL if the object is not a relation or part of a relation|||| | ||
+ | ||page|integer| |Page number within the relation, or NULL if the object is not a tuple or relation page|||| | ||
+ | ||tuple|smallint| |Tuple number within the page, or NULL if the object is not a tuple|||| | ||
+ | ||virtualxid|text| |Virtual ID of a transaction, | ||
+ | ||transactionid|xid| |ID of a transaction, | ||
+ | ||classid|oid|pg_class.oid|OID of the system catalog containing the object, or NULL if the object is not a general database object|||| | ||
+ | ||objid|oid|any OID column|OID of the object within its system catalog, or NULL if the object is not a general database object|||| | ||
+ | ||objsubid|smallint| |For a table column, this is the column number (the classid and objid refer to the table itself). For all other object types, this column is zero. NULL if the object is not a general database object|||| | ||
+ | ||virtualtransaction|text| |Virtual ID of the transaction that is holding or awaiting this lock|||| | ||
+ | ||pid|integer| |Process ID of the server process holding or awaiting this lock. NULL if the lock is held by a prepared transaction|Идентификатор процесса в ОС соответствует выводу команды [[ps]], например: | ||
+ | ||mode|text| |Name of the lock mode held or desired by this process|Текстовое описание [[postgresql# | ||
+ | ||granted|boolean| |True if lock is held, false if lock is awaited|Значение t (true) значит установлена, | ||
+ | |||
+ | < | ||
+ | # select * from pg_locks; | ||
+ | locktype | ||
+ | ------------+----------+----------+------+-------+------------+---------------+---------+-------+----------+--------------------+------+-----------------+--------- | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | |||
+ | </ |
📌 Удобный подбор VPS по параметрам доступен на DIEGfinder.com - официальном инструменте проекта DIEG. Это часть единой экосистемы, созданной для того, чтобы помочь быстро найти подходящий VPS/VDS сервер для любых задач хостинга.
📌 Для тестирования скриптов, установщиков VPN и Python-ботов рекомендуем использовать надежные VPS на короткий срок. Подробнее о быстрой аренде VPS для экспериментов - читайте здесь.
💥 Подпишись в Телеграм 💥 и задай вопрос по сайтам и хостингам бесплатно!7 Самых Популярных Статей
- Как запустить скрипты и веб-приложения на Python
- Что такое страны TIER 1,2,3
- 7 способов сравнения файлов по содержимому в Windows или Linux
- Установка и тестирование веб-панели HestiaCP
- Nginx простые примеры конфигурации
- top, htop, atop определение загрузки ОС (Load average, LA)
- Использование rsync в примерах
7 Самых Популярных Обзоров
- Хостинг для Python-скриптов и приложений
- ТОП 4 лучших антидетект браузеров (Бесплатные & Платные)
- Подборка купонов (промокоды) на хостинг, антидетект браузеры
- Обзор THE.Hosting (PQ Hosting): надежный хостинг с профессиональной поддержкой
- Хостинг в России
- Хостинг в Европе
- Обзор браузера Dolphin {anty} для мультиаккаунтинга