如下:select * from pg_stat_activity查询系统中的进程如果怀疑哪张表被锁了,可以执行如下sql:select oid from pg_class where relname='table_name