Thread

  1. BUG #19057: Installing postgresql-15 from the repostory installs a mix of postgresql 15 and 17

    PG Bug reporting form <noreply@postgresql.org> — 2025-09-18T21:24:39Z

    The following bug has been logged on the website:
    
    Bug reference:      19057
    Logged by:          Chris Woelkers - NOAA Federal
    Email address:      chris.woelkers@noaa.gov
    PostgreSQL version: 15.14
    Operating system:   Debian 13 - Trixie
    Description:        
    
    How I found the issue:
    I started a new VM with a fresh install of Debian 13.1 and after some basic
    setup added the postgresql apt repository. I then tried installing
    postgresql-15 and postgresql-17. Afterwards I ran pg_lsclusters and only saw
    version 17 listed. I checked under /etc/postgresql and /var/lib/postgresql
    and the only subdirectory in each was 17. I then uninstalled both packages
    plus the other postgresql dependencies and rebooted.
    I then tried installing just the postgresql-15 package, plus automatic
    dependencies. Afterwards I ran pg_lsclusters again and still only say 17
    listed. Checking the previous directories again also shows 17 as the only
    subdirectory. I ran pg_config --version and it reported the version as 15.14
    as did psql --version.
    Lastly I did a general search for any files or directories named postgresql,
    using 'locate'. The results led me to finding that the /usr/share/postgresql
    and /usr/lib/postgresql directories both list the proper version number.
    
    Why this is an issue:
    I need to transfer a v15 DB to this new server which will then have v17
    installed to upgrade it. This will require both to be properly listed in
    pg_lsclusters and to use the proper subdirectory names.
    
    Steps to reproduce:
    1. Start with a Debian 13 system.
    2. Add the PostgreSQL APT repository.
    3. Install the package "postgresql-15".
    4. Run pg_lscluster to view the currently available clusters, notice the
    incorrect version number.
    5. List the contents of /etc/postgresql and /var/lib/postgresql. Notice the
    incorrect version number.
    
    Terminal outputs:
    root@postgres2:/var/log/apt# apt list postgresql-15
    postgresql-15/trixie-pgdg,now 15.14-1.pgdg13+1 amd64 [installed]
    root@postgres2:/var/log/apt# apt list postgresql-17
    postgresql-17/trixie-pgdg,now 17.6-1.pgdg13+1 amd64 [residual-config]
    root@postgres2:/var/log/apt# pg_lsclusters
    Ver Cluster Port Status                Owner    Data directory
    Log file
    17  main    5432 down,binaries_missing postgres /var/lib/postgresql/17/main
    /var/log/postgresql/postgresql-17-main.log
    root@postgres2:/var/log/apt# psql --version
    psql (PostgreSQL) 15.14 (Debian 15.14-1.pgdg13+1)
    root@postgres2:/var/log/apt# ls /etc/postgresql
    17
    root@postgres2:/var/log/apt# ls /var/lib/postgresql/
    17