I am truncating a large table - a few Terrabytes in size. To ensure that there are no locking issues, I executed the following query in another window and the results are also there. Why isn't the table begin truncated no there is the query result?
select c.relname,
l.locktype,
l.pid,
l.mode,
l.granted FROM pg_locks l
JOIN pg_class c ON l.relation = c.oid;
relname | locktype | pid | mode | granted
-----------------------------------+----------+------+-----------------+---------
pg_class_tblspc_relfilenode_index | relation | 6931 | AccessShareLock | t
pg_class_relname_nsp_index | relation | 6931 | AccessShareLock | t
pg_class_oid_index | relation | 6931 | AccessShareLock | t
pg_class | relation | 6931 | AccessShareLock | t
pg_locks | relation | 6931 | AccessShareLock | t