Regular Expression for Postgres log messages warning of locks

To match locks in Postgres logs you can use the following regular expressions. The first matches messages that show tables being locked, and the second shows the application loading share locks. .*user=(?P<lock_user_name>\w+),db=(?P<lock_database>\w+) LOG:\s+process (?P<lock_process_id>\d+) acquired (?P<lock_type>\w+) on (?<lock_on>\w+) (?P<lock_tuple>[\(\)0-9,]+) of (?P<lock_object_type>\w+) (?P<lock_object_oid>\d+) of database (?P<lock_db_oid>\d+) after (?P<lock_wait_time>[0-9.]+).* .*user=(?P<lock_user_name>\w+),db=(?P<lock_database>\w+) LOG:\s+process (?P<lock_process_id>\d+) acquired (?P<lock_type>\w+) on transaction (?<lock_transaction_id>\d+) …