> -----Ursprüngliche Nachricht-----
> On Wed, 2025-02-19 at 08:45 +0000, Schmid Andreas wrote:
> > I'm trying to install the postgresql-17 Debian package from PGDG apt
> > repo alongside an already existing PostgreSQL 16 installation. So
> > there is already a PostgreSQL 16 cluster on my machine (which I want
> > to upgrade to version 17 using the pg_upgrade command later on).
> >
> > If I'm not wrong, the PostgreSQL packages used to automatically create
> > a new cluster during installation, even if there already was an older
> > cluster present. (Using a different port in this case.) But this
> > doesn't happen with the 17.3 package. Does anyone know if this
> > behavior has changed? Or anyone can explain on which conditions a new
> > cluster is created and when not?
> >
> > There was a now closed discussion on this topic on Stack Overflow:
> > https://stackoverflow.com/questions/79441161/postgres-17-3-installatio
> > n-no-longer-creates-a-new-cluster Of course, I will create the
> > additional cluster using pg_createcluster if this is the way to go.
> > The point is that I'm installing PostgreSQL using an Ansible script,
> > and pg_createcluster was not needed until now.
> > So before I update my script, I hope to get some more information
> > about the behavior of the PostgreSQL packages regarding automatic cluster
> creation.
>
> I just tried on an Ubuntu system (I think that the packages are pretty much
> the same), and installing 17.3 created a cluster.
> I think the Stackoverflow question was about installing 17.3 if v17 is already
> installed. In that case, no new cluster is created.
>
Well, according to the last comment below the Stack Overflow question, it was about installing 17.3 with a v14 cluster
alreadypresent.
Anyways, I now tried on an Ubuntu 24.04 machine as well, and installing 17.3 alone created a cluster.
Cleaned up the machine, then installed 15.11, which created a cluster. Installed 16.7 alongside, which did not create
anadditional cluster. So it's probably not a 17.3 problem.
Same outcome on Ubuntu 20.04.
Maybe there generally is no cluster created if there is one present already. I now checked
/usr/share/postgresql-common/maintscripts-functionswhich is installed by the postgresql-common_273.pgdg24.04+1_all.deb
package.This script contains the create_main_cluster() function, which according to a comment "skips if any other
clusteralready exists".
So could it be that this function has been updated recently? Can you point me to the repo where this script is
maintained?