pg_activity icon indicating copy to clipboard operation
pg_activity copied to clipboard

iso_8601 intervalstyle currently not supported

Open thiagosantosleite opened this issue 4 months ago • 1 comments

Hi guys!

Any plans to support different values for intervalstyle? maybe set this in the session level? are there any workarounds available ?

Traceback (most recent call last):
  File "/usr/bin/pg_activity", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/usr/lib/python3/dist-packages/pgactivity/cli.py", line 413, in main
    ui.main(term, cfg, dataobj, host, args)
  File "/usr/lib/python3/dist-packages/pgactivity/ui.py", line 31, in main
    server_information = data.pg_get_server_information(
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/pgactivity/data.py", line 325, in pg_get_server_information
    ret = pg.fetchone(
          ^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/pgactivity/pg.py", line 240, in fetchone
    row = cur.fetchone()
          ^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/psycopg2/extras.py", line 82, in fetchone
    res = super().fetchone()
          ^^^^^^^^^^^^^^^^^^
psycopg2.NotSupportedError: iso_8601 intervalstyle currently not supported

Environment:

cat /etc/os-release                                                                                                                                                                                          1m 2s ▼ 15:17:47
PRETTY_NAME="Ubuntu 24.04.2 LTS"
NAME="Ubuntu"
VERSION_ID="24.04"
VERSION="24.04.2 LTS (Noble Numbat)"
VERSION_CODENAME=noble
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=noble
LOGO=ubuntu-logo

pg_activity --version                                                                                                                                                                                              ▼ 15:18:44
pg_activity 3.4.2

Database info:

tenant-8b68e473-5988-4c03-ab6c-633198385d6a=> show intervalstyle;
 IntervalStyle 
---------------
 iso_8601
(1 row)

Thanks!

thiagosantosleite avatar Sep 01 '25 18:09 thiagosantosleite

It seems you're using psycopg2 as a database driver (which is normal as this is the dependency of the Debian/Ubuntu package). Can you try installing the python3-psycopg distribution (apt install) and report back?

dlax avatar Sep 02 '25 06:09 dlax