Skip to content

support for PostgeSQL 10.0+ #100

Description

Traceback (most recent call last):
  File "/usr/bin/pg_view", line 11, in <module>
    load_entry_point('pg-view==1.4.1', 'console_scripts', 'pg_view')()
  File "/usr/lib/python3.6/site-packages/pg_view.py", line 3474, in main
    postmasters = get_postmasters_directories()
  File "/usr/lib/python3.6/site-packages/pg_view.py", line 3038, in get_postmasters_directories
    postmasters[pg_dir] = [pid, version, dbname]
UnboundLocalError: local variable 'version' referenced before assignment
PG_VERSION_FILENAME:
# cat /proc/<PG PID>/cwd/PG_VERSION
10
fp = open(PG_VERSION_FILENAME, 'rU')
  val = fp.read().strip()
  if val is not None and len(val) >= 3:
      version = float(val)

I do not understand why "len(val) >= 3"
"len(val) >= 1" should be enought.

Unable to read free space information for the pg_xlog and data directories for the directory /pg: [Errno 2] No such file or directory: '/pg/pg_xlog/'
ERROR: 2018-05-24 23:25:55,870 Unable to read free space information for the pg_xlog and data directories for the directory /pg: [Errno 2] No such file or directory: '/pg/pg_xlog/'
Process DetachedDiskStatCollector-1:
Traceback (most recent call last):
File "/usr/lib/python3.6/multiprocessing/process.py", line 258, in _bootstrap
self.run()
File "/usr/lib/python3.6/site-packages/pg_view.py", line 3560, in run
df_data = self.get_df_data(wd)
File "/usr/lib/python3.6/site-packages/pg_view.py", line 3615, in get_df_data
xlog_dev = self.get_mounted_device(self.get_mount_point(work_directory + '/pg_xlog/'))
File "/usr/lib/python3.6/site-packages/pg_view.py", line 3679, in get_mount_point
parent_device = path_device = os.stat(pathname).st_dev
FileNotFoundError: [Errno 2] No such file or directory: '/pg/pg_xlog'

Activity

  1. hjacobs commented on May 25, 2018

    @hjacobs
    Contributor

    @nri-pl thanks for reporting!

  2. alexeyklyukin commented on May 25, 2018

    @alexeyklyukin
    Contributor

    File "/usr/lib/python3.6/site-packages/pg_view.py", line 3474, in main

    This looks like an old (one single file) version of pg_view. We moved one for more than a year.

    I do not understand why "len(val) >= 3"
    "len(val) >= 1" should be enought.

    It's a valid point. That has been fixed at #89
    Feel free to give it a spin

  3. mohag commented on Mar 14, 2025

    @mohag

    Is there a release (or installation instructions) of the newer version? (pip seems to install 1.4.1, which has this issue)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions