Hallo, in my opinion the cleanest patch would be to change the file location of postgresql.auto.conf to the /etc/postgresql/version/cluster directory. But a you pointed out, this is hardcoded into postgresql.
So a patch to postgresql for enabling this, means making this a compile time option instead of being hardcoded. This option eg --location_of_postgresql_auto could then be set at compile time. hth, Wim ________________________________ Van: Christoph Berg <m...@debian.org> Verzonden: woensdag 27 februari 2019 15:37 Aan: Wim Bertels; 919...@bugs.debian.org Onderwerp: Re: Bug#919385: postgresql-common: alter system set port ignored by pg-commands I was looking into several ideas that all have some problems. 0. Look into pg_settings Doesn't work because we can only query the database if we already know the port 1. Put the port on the postgres command line (postgres -p 5555) Works, but then restarting the server is hard once the port got changed. `pg_ctl restart` will even preserve the last command line. 2. Put the port into a file next to /var/run/postgresql/11-main.pid Has several consistency issues. If the port is changed, the file is not updated immediately. If the cluster is shut down, should the file be removed? 3. Write a suid wrapper that read postgresql.auto.conf suid programs are a security nightmare. 4. Patch PostgreSQL such that it puts the port into external_pid_file, i.e. into /var/run/postgresql/11-main.pid Patching the server is evil, and it breaks applications reading the external file that are not prepared to ignore extra information The bottom line is that #4 looks most attractive, but I'm not fixing this in postgresql-common now. I will try sending a patch for #4 to upstream and see if it gets accepted for PG 12+. If so, we can still patch the older versions on our side. Christoph