command-not-found suggests postgresql-client-common when trying to use psql for the first time, but this package is useless

Bug #1939412 reported by Igor Mosyagin
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
command-not-found (Ubuntu)
New
Undecided
Unassigned

Bug Description

1 and 2:

```
 $ lsb_release -rd
Description: Ubuntu 20.04.2 LTS
Release: 20.04

 $ apt-cache policy command-not-found
command-not-found:
  Installed: 20.04.4
  Candidate: 20.04.4
  Version table:
 *** 20.04.4 500
        500 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages
        500 http://archive.ubuntu.com/ubuntu focal-updates/main i386 Packages
        100 /var/lib/dpkg/status
     20.04.2 500
        500 http://archive.ubuntu.com/ubuntu focal/main amd64 Packages
        500 http://archive.ubuntu.com/ubuntu focal/main i386 Packages

```

I was trying to connect to psql server. I didn't know what package I need to install so hoped that the I would get help from the system itself:

```
 $ psql

Command 'psql' not found, but can be installed with:

sudo apt install postgresql-client-common
```

3) What I expected to happen:
I was expecting that after installing postgresql-client-common I would be able to run the command.

Digging further, I found out that there's only one postgresql-client-<version> package (postgresql-client-12), and that's not the latest version of psql. I expect to be suggested to install either `postgresql-client` or a correct version of `postgresql-client-<version>` package

4) What happened instead:
I was not able to run command straightaway and had to figure out which package to install next with no clear help

Here's what happened when I was installing it:
```
 $ sudo apt-get install postgresql-client-common
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
  postgresql-client-common
0 upgraded, 1 newly installed, 0 to remove and 1 not upgraded.
Need to get 28,2 kB of archives.
After this operation, 182 kB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 postgresql-client-common all 214ubuntu0.1 [28,2 kB]
Fetched 28,2 kB in 0s (93,2 kB/s)
Selecting previously unselected package postgresql-client-common.
(Reading database ... 282382 files and directories currently installed.)
Preparing to unpack .../postgresql-client-common_214ubuntu0.1_all.deb ...
Unpacking postgresql-client-common (214ubuntu0.1) ...
Setting up postgresql-client-common (214ubuntu0.1) ...
Processing triggers for man-db (2.9.1-1) ...
```

Here's the error message:
```
 $ psql --host 178.154.223.198 -U user9 db9
Error: You must install at least one postgresql-client-<version> package
```

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.