heroku / heroku-pg-extras

A heroku plugin for awesome pg:* commands that are also great and fun and super.
MIT License
1.33k stars 102 forks source link

Expand pg:locks query #166

Closed mble closed 2 years ago

mble commented 6 years ago

This commit expands the pg:locks query to better handle expanded lock types, and provide richer information about the locks.

The main downside is that by including more lock types, there is a lot more information. For example, obtaining an AccessExclusiveLock on a table (as part of DROP TABLE), grabs locks on sequences, TOAST data and indexes as well as the table itself, as well as locks on pg_type and other system tables, that aren't easily understood.

This is best highlighted with the updated example in the README.

In order to help account for this, new columns have been added to help identify the lock types as well as lock modes, and provide some further information. This might be too much, so feedback is deeply appreciated.

Fixes #149

stof commented 4 years ago

Will this ever be merged ?

mble commented 4 years ago

@stof I'll take a look at this again, but I can't provide a timeline on it being merged and released.

stof commented 2 years ago

Is this change rejected, even though it had been approved ?

mble commented 2 years ago

@stof Much of pg-extras has made it into the main CLI (https://github.com/heroku/cli/blob/master/packages/pg-v5) so any further changes to this query will likely happen there.

There have also been additional lock events exposed by Postgres since this was further authored, so needs another look.

stof commented 2 years ago

@mble I think the link you gave is the wrong one

mble commented 2 years ago

@stof oops, corrected in the original post. Paste buffer management!

lyuboxa commented 2 years ago

https://github.com/heroku/cli/blob/master/packages/pg-v5/commands/locks.js