Created
April 23, 2023 06:56
-
-
Save dreamlu/eb12ee9ea6119f254821cca3221b8730 to your computer and use it in GitHub Desktop.
pg 锁住/解锁
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select pid, query | |
from pg_stat_activity | |
where datname = 'table' | |
and wait_event_type = 'Lock'; | |
select 'select pg_cancel_backend( ''' || pid || ''');' pid | |
from pg_stat_activity | |
where datname = 'table' | |
and wait_event_type = 'Lock'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment