Sha256: 9b0979a5cbaa11bff8b6803a91098e85648f6619aadf8c05d2dac32b6c687b4b

Contents?: true

Size: 710 Bytes

Versions: 6

Compression:

Stored size: 710 Bytes

Contents

/* Queries with active exclusive locks */

SELECT
  pg_stat_activity.pid,
  pg_class.relname,
  pg_locks.transactionid,
  pg_locks.locktype,
  pg_locks.database,
  pg_locks.granted,
  pg_locks.mode,
  pg_stat_activity.query AS query_snippet,
  age(now(),pg_stat_activity.query_start) AS "age",
  pg_stat_activity.application_name AS application
FROM pg_stat_activity,pg_locks left
OUTER JOIN pg_class
  ON (pg_locks.relation = pg_class.oid)
WHERE pg_stat_activity.query <> '<insufficient privilege>'
  AND pg_locks.pid = pg_stat_activity.pid
  AND pg_locks.mode IN ('ExclusiveLock', 'AccessExclusiveLock', 'RowExclusiveLock')
  AND pg_stat_activity.pid <> pg_backend_pid()
ORDER BY query_start
LIMIT %{limit};

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
ruby-pg-extras-5.4.5 lib/ruby_pg_extras/queries/locks.sql
ruby-pg-extras-5.4.4 lib/ruby_pg_extras/queries/locks.sql
ruby-pg-extras-5.4.3 lib/ruby_pg_extras/queries/locks.sql
ruby-pg-extras-5.4.2 lib/ruby_pg_extras/queries/locks.sql
ruby-pg-extras-5.4.1 lib/ruby_pg_extras/queries/locks.sql
ruby-pg-extras-5.4.0 lib/ruby_pg_extras/queries/locks.sql