Skip to content

Instantly share code, notes, and snippets.

@stevenharman
Last active April 3, 2018 17:23

Revisions

  1. stevenharman renamed this gist Sep 12, 2013. 1 changed file with 0 additions and 0 deletions.
  2. stevenharman revised this gist Sep 12, 2013. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion posgtres_open_connections.sql
    Original file line number Diff line number Diff line change
    @@ -4,7 +4,7 @@
    -- An explaination of the columns on the pg_stat_activity table:
    -- http://www.postgresql.org/docs/9.2/static/monitoring-stats.html#PG-STAT-ACTIVITY-VIEW
    select
    pid,application_name,query,waiting,state,state_change
    pid, application_name, query, waiting, state, state_change
    from pg_stat_activity
    where usename = current_user
    order by state_change desc;
  3. stevenharman revised this gist Sep 12, 2013. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions posgtres_open_connections.sql
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,8 @@
    -- On Heroku:
    -- $ heroku pg:psql

    -- An explaination of the columns on the pg_stat_activity table:
    -- http://www.postgresql.org/docs/9.2/static/monitoring-stats.html#PG-STAT-ACTIVITY-VIEW
    select
    pid,application_name,query,waiting,state,state_change
    from pg_stat_activity
  4. stevenharman created this gist Sep 12, 2013.
    7 changes: 7 additions & 0 deletions posgtres_open_connections.sql
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    -- On Heroku:
    -- $ heroku pg:psql
    select
    pid,application_name,query,waiting,state,state_change
    from pg_stat_activity
    where usename = current_user
    order by state_change desc;