agora inbox for pgsql-bugs@postgresql.org  
help / color / mirror / Atom feed
From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: pritt1999@gmail.com
Subject: BUG #19562: pgcli packaged by the PostgreSQL Yum Repository:ModuleNotFoundError: No module named 'pgspecial'
Date: Tue, 21 Jul 2026 06:41:32 +0000
Message-ID: <19562-9d41f689d05188c3@postgresql.org> (raw)

The following bug has been logged on the website:

Bug reference:      19562
Logged by:          Pritt Balagopal
Email address:      pritt1999@gmail.com
PostgreSQL version: 18.4
Operating system:   Fedora 44
Description:        

This bug report does not apply to PostgreSQL 18.4, nor to pgcli either.
Rather, it concerns the specific methodology by which pgcli is packaged for
distribution within the PostgreSQL Yum Repository.

How to reproduce the bug:

Create the Fedora 44 container environment using Podman (Docker is also
applicable here, the commands work the same way):

```
podman create -it --name fedora44 quay.io/fedora/fedora:44 /bin/bash
```

Run the Fedora 44 container environment, and enter its shell:

```
podman start -ai fedora44
```

Within the shell, run a quick `dnf update` and then proceed to import the
PostgreSQL yum repository as outlined in:
https://www.postgresql.org/download/linux/redhat/

```
dnf install
https://download.postgresql.org/pub/repos/yum/reporpms/F-44-x86_64/pgdg-fedora-repo-latest.noarch.rp...
```

Now, install pgcli:

```
dnf install pgcli
```

You should see dnf prompting you for confirmation with the pgcli being
sourced from `pgdg-common`. Accept and import GPG keys as prompted:

```
Package                                                                 Arch
Version
Repository                                    Size
Installing:
 pgcli
noarch          0:4.3.0-2PGDG.f44
pgdg-common                               60.3 KiB
Installing dependencies:
 expat
x86_64          0:2.8.1-1.fc44
updates                                  327.4 KiB
 mpdecimal
x86_64          0:4.0.1-3.fc44
fedora                                   217.1 KiB
 python-pip-wheel
noarch          0:26.0.1-2.fc44
fedora                                     1.2 MiB
 python3
x86_64          0:3.14.6-1.fc44
updates                                   28.7 KiB
 python3-cli-helpers
noarch          0:2.2.1-2.f44
pgdg-common                              115.2 KiB
 python3-cli-helpers+styles
noarch          0:2.2.1-2.f44
pgdg-common                                0.0   B
 python3-click
noarch          1:8.3.3-1.fc44
updates                                    1.2 MiB
 python3-configobj
noarch          0:5.0.9-9.fc44
fedora                                   399.3 KiB
 python3-humanize
noarch          0:4.15.0-2.fc44
fedora                                   231.5 KiB
 python3-jedi
noarch          0:0.19.2-10.fc44
fedora                                     5.6 MiB
 python3-libs
x86_64          0:3.14.6-1.fc44
updates                                   43.9 MiB
 python3-parso
noarch          0:0.8.5-3.fc44
fedora                                   900.7 KiB
 python3-pgcli
noarch          0:4.3.0-2PGDG.f44
pgdg-common                              637.8 KiB
 python3-pygments
noarch          0:2.19.1-9.fc44
fedora                                    11.3 MiB
 python3-setproctitle
x86_64          0:1.3.7-4.fc44
fedora                                    41.7 KiB
 python3-sqlparse
noarch          0:0.5.3-4.fc44
fedora                                   386.3 KiB
 python3-tabulate
noarch          0:0.9.0-19.fc44
fedora                                   347.1 KiB
 python3-tabulate+widechars
noarch          0:0.9.0-19.fc44
fedora                                     0.0   B
 python3-terminaltables
noarch          0:3.1.10-20.fc44
fedora                                    94.7 KiB
 python3-wcwidth
noarch          0:0.6.0-1.fc44
fedora                                   470.6 KiB
Installing weak dependencies:
 python-unversioned-command
noarch          0:3.14.6-1.fc44
updates
```

Once the installation is complete, invoke the `pgcli` executable and you
will be met with an error:

```
Traceback (most recent call last):
  File "/usr/bin/pgcli", line 3, in <module>
    from pgcli.main import cli
  File "/usr/lib/python3.14/site-packages/pgcli/main.py", line 3, in
<module>
    from pgspecial.namedqueries import NamedQueries
ModuleNotFoundError: No module named 'pgspecial'
```

The fact that this module is not imported by default when `pgcli` is
packaged for RPM is not the expected behavior. However, even if one were to
bypass this limitation by manually installing the `pgspecial` python module
via:

```
dnf install python3-pgspecial
```

This still does not solve the problem of using `pgcli` as packaged by the
PostgreSQL Yum repository:

```
Traceback (most recent call last):
  File "/usr/bin/pgcli", line 3, in <module>
    from pgcli.main import cli
  File "/usr/lib/python3.14/site-packages/pgcli/main.py", line 23, in
<module>
    from cli_helpers.tabular_output.preprocessors import (
    ...<3 lines>...
    )
ImportError: cannot import name 'format_timestamps' from
'cli_helpers.tabular_output.preprocessors'
(/usr/lib/python3.14/site-packages/cli_helpers/tabular_output/preprocessors.py)
```

Note. This is NOT a bug within `pgcli` itself. Rather, this is a bug in the
packaging of `pgcli` within the PostgreSQL Yum repository. We can verify
this by installing `pgcli` from Fedora official repositories instead of
`pgdg-common`. To do this, delete the previous container and begin anew.
This time, do not import the PostgreSQL Yum Repository:

```
dnf install pgcli
```

```
Package                                                                 Arch
Version
Repository                                    Size
Installing:
 pgcli
noarch          0:4.5.0-1.fc44
updates                                  649.9 KiB
Installing dependencies:
 expat
x86_64          0:2.8.1-1.fc44
updates                                  327.4 KiB
 libpq
x86_64          0:18.0-4.fc44
fedora                                     1.0 MiB
 mpdecimal
x86_64          0:4.0.1-3.fc44
fedora                                   217.1 KiB
 python-pip-wheel
noarch          0:26.0.1-2.fc44
fedora                                     1.2 MiB
 python3
x86_64          0:3.14.6-1.fc44
updates                                   28.7 KiB
 python3-cli-helpers
noarch          0:2.10.1-1.fc44
fedora                                   129.6 KiB
 python3-cli-helpers+styles
noarch          0:2.10.1-1.fc44
fedora                                     0.0   B
 python3-click
noarch          1:8.3.3-1.fc44
updates                                    1.2 MiB
 python3-configobj
noarch          0:5.0.9-9.fc44
fedora                                   399.3 KiB
 python3-libs
x86_64          0:3.14.6-1.fc44
updates                                   43.9 MiB
 python3-pgspecial
noarch          0:2.2.1-7.fc44
fedora                                   363.8 KiB
 python3-prompt-toolkit
noarch          0:3.0.52-2.fc44
fedora                                     4.2 MiB
 python3-psycopg3
noarch          0:3.3.4-1.fc44
updates                                    2.0 MiB
 python3-pygments
noarch          0:2.19.1-9.fc44
fedora                                    11.3 MiB
 python3-setproctitle
x86_64          0:1.3.7-4.fc44
fedora                                    41.7 KiB
 python3-sqlparse
noarch          0:0.5.3-4.fc44
fedora                                   386.3 KiB
 python3-tabulate
noarch          0:0.9.0-19.fc44
fedora                                   347.1 KiB
 python3-tabulate+widechars
noarch          0:0.9.0-19.fc44
fedora                                     0.0   B
 python3-terminaltables
noarch          0:3.1.10-20.fc44
fedora                                    94.7 KiB
 python3-tzlocal
noarch          0:5.3.1-6.fc44
fedora                                   125.3 KiB
 python3-wcwidth
noarch          0:0.6.0-1.fc44
fedora                                   470.6 KiB
Installing weak dependencies:
 python-unversioned-command
noarch          0:3.14.6-1.fc44
updates
```

Once the installation of pgcli from Fedora packaging has completed, invoking
the command `pgcli` shows the expected response:

```
connection is bad: connection to server on socket
"/var/run/postgresql/.s.PGSQL.5432" failed: No such file or directory
        Is the server running locally and accepting connections on that
socket?
```








view thread (4+ messages)  latest in thread

Message-ID: <19562-9d41f689d05188c3@postgresql.org>
Permalink:  ../19562-9d41f689d05188c3@postgresql.org/
Also on:    postgresql.org/message-id/19562-9d41f689d05188c3@postgresql.org

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: noreply@postgresql.org, pgsql-bugs@lists.postgresql.org, pritt1999@gmail.com
  Subject: Re: BUG #19562: pgcli packaged by the PostgreSQL Yum Repository:ModuleNotFoundError: No module named 'pgspecial'
  In-Reply-To: <19562-9d41f689d05188c3@postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox