
Best definition by Tom Lane, I Believe every email from him is a lesson, he is Dr. That will succeed only when the other transaction terminates and releases its locks." (regards, tom lane). If one transaction finds it necessary to wait specifically for another transaction, it does so by attempting to acquire share lock on the other transaction ID.

It blocks INSERT, UPDATE, DELETE, ALTER TABLE, DROP TABLE, and VACUUM commands. ShareLock: It acquired automatically by a CREATE INDEX command.It blocks ALTER TABLE, DROP TABLE, VACUUM, and CREATE INDEX commands ( ShareLock, ShareRowExclusiveLock, ExclusiveLock, and AccessExclusiveLock) on the same table. RowExclusiveLock: It acquired automatically by an UPDATE, INSERT, or DELETE command.It blocks concurrent ExclusiveLock and AccessExclusiveLock on the same table.

RowShareLock : It acquired automatically by a SELECT.FOR UPDATE clause.This mode blocks ALTER TABLE, DROP TABLE, and VACUUM (AccessExclusiveLock) on the same table

AcessShareLock : It acquired automatically by a SELECT statement on the table or tables it retrieves from.
