zalando / pg_view

Get a detailed, real-time view of your PostgreSQL database and system metrics
https://pypi.python.org/pypi/pg-view
Other
494 stars 49 forks source link

Incompatible with postgresql 9.6 #68

Closed ghost closed 7 years ago

ghost commented 7 years ago

Postgresql 9.6 RC1 has been released, and there are some changes in the schematic.

When you run pg_view you get the error:

$ pg_view
Traceback (most recent call last):
  File "/home/roel/.local/lib/python2.7/site-packages/pg_view.py", line 3432, in main
    loop(collectors, consumer, groups, output_method)
  File "/home/roel/.local/lib/python2.7/site-packages/pg_view.py", line 2748, in loop
    curses.wrapper(do_loop, groups, output_method, collectors, consumer)
  File "/usr/lib/python2.7/curses/wrapper.py", line 43, in wrapper
    return func(stdscr, *args, **kwds)
  File "/home/roel/.local/lib/python2.7/site-packages/pg_view.py", line 2816, in do_loop
    process_single_collector(st)
  File "/home/roel/.local/lib/python2.7/site-packages/pg_view.py", line 2845, in process_single_collector
    st.refresh()
  File "/home/roel/.local/lib/python2.7/site-packages/pg_view.py", line 1187, in refresh
    stat_data = self._read_pg_stat_activity()
  File "/home/roel/.local/lib/python2.7/site-packages/pg_view.py", line 1408, in _read_pg_stat_activity
    """)
  File "/home/roel/.local/lib/python2.7/site-packages/psycopg2/extras.py", line 223, in execute
    return super(RealDictCursor, self).execute(query, vars)
ProgrammingError: column "waiting" does not exist
LINE 8:                            waiting,
                                   ^

From the RC release notes ( https://www.postgresql.org/docs/9.6/static/release-9-6.html ):

Improve the pg_stat_activity view's information about what a process is waiting for (Amit Kapila, Ildus Kurbangaliev)

Historically a process has only been shown as waiting if it was waiting for a heavyweight lock. Now waits for lightweight locks and buffer pins are also shown in pg_stat_activity. Also, the type of lock being waited for is now visible. These changes replace the waiting column with wait_event_type and wait_event.

New pg_stat_activity information: https://www.postgresql.org/docs/9.6/static/monitoring-stats.html#PG-STAT-ACTIVITY-VIEW

a1exsh commented 7 years ago

A fix for this was committed as early as April this year: https://github.com/zalando/pg_view/commit/43e1c21c60948ba516ac29325e6cab58326be568

You might want to use a version from master, and we might want to release a new version ;-)