The variable $PSQL_VERSION is not taken into account when starting PostgreSQL
I don't know if this worked, but it seems to not work anymore:
$ pg_lsclusters
Ver Cluster Port Status Owner Data directory Log file
9.3 main 5432 down odoo /var/lib/postgresql/9.3/main pg_log/postgresql.log
9.5 main 5432 down odoo /var/lib/postgresql/9.5/main pg_log/postgresql.log
9.6 main 5432 down odoo /var/lib/postgresql/9.6/main pg_log/postgresql.log
10 main 5432 down odoo /var/lib/postgresql/10/main pg_log/postgresql.log
$ echo $PSQL_VERSION
9.5
$ service postgresql start
* Starting PostgreSQL 9.3 database server [ OK ]
$
Debugging a little, I noticed the value of the variable $PSQL_VERSION
is not retrievable in the init scripts, neither in /etc/init.d/postgresql
, nor /usr/share/postgresql-common/init.d-functions
.
If I try to print the variable inside those scripts, nothing is printed, like if it was undefined.