I am doing a simple insert row inside of a transaction, here is the steps that I followed
- begin;
- insert data
- query pg_locks
The pg_locks now says that there is an Exclusive lock as in the picture below.
According to the documentation an Exclusive Lock is only Acquired by refresh materialized view concurrently.
What am I doing wrong here?
Using pgsql - 9.4
Pg Locks table before insert has four rows, this is due to querying the pg_locks table itself in two separate sessions.
After insert it has two extra rows, one which is the actual transaction id itself which is an exclusive lock and another is on relation RowExclusiveLock
ExclusiveLockis not held for a relation (and please post sample data like that as formatted text, not as a screenshot) - a_horse_with_no_name