I have a PostgreSQL cluster with few databases. In one of the DBs, if I try to create a new table, the command never ends until I kill the the linux proccess. I checked pg_lock
and found that pg_class
and the indexes on pg_class
are locked, lock type is relation
and mode is RowExclusiveLock
.
I can add a column to a table but cannot create an index on a table.
If I create a table in another database, there are no locks on pg_class
.
Every hint can help.
Here there is description of locks:
relname locktype mode
pg_class_tblspc_relfilenode_index relation RowExclusiveLock
pg_class_relname_nsp_index relation RowExclusiveLock
pg_class_oid_index relation RowExclusiveLock
pg_class relation RowExclusiveLock
pg_class
andpg_lock
, and what exactly you are doing? Also, there should be something in the logs, too, if the statement is waiting for longer. Also, do you see the process inpg_stat_activity
that holds the lock?