Thread: pgsql: Add a function GetLockConflicts() to lock.c to report xacts

pgsql: Add a function GetLockConflicts() to lock.c to report xacts

From
tgl@postgresql.org (Tom Lane)
Date:
Log Message:
-----------
Add a function GetLockConflicts() to lock.c to report xacts holding
locks that would conflict with a specified lock request, without
actually trying to get that lock.  Use this instead of the former ad hoc
method of doing the first wait step in CREATE INDEX CONCURRENTLY.
Fixes problem with undetected deadlock and in many cases will allow the
index creation to proceed sooner than it otherwise could've.  Per
discussion with Greg Stark.

Modified Files:
--------------
    pgsql/src/backend/commands:
        indexcmds.c (r1.147 -> r1.148)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/commands/indexcmds.c.diff?r1=1.147&r2=1.148)
    pgsql/src/backend/storage/lmgr:
        lock.c (r1.171 -> r1.172)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/storage/lmgr/lock.c.diff?r1=1.171&r2=1.172)
    pgsql/src/include/storage:
        lock.h (r1.97 -> r1.98)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/include/storage/lock.h.diff?r1=1.97&r2=1.98)