You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While initializing the database cluster on redhat like systems use postgresql-XX-setup initdb instead of falling back to pg_ctl as show in the documentation
#3
Open
davidassigbi opened this issue
Jul 10, 2024
· 0 comments
While initializing the database cluster on redhat with the program postgresql-XX-setup, it seems to retrieve the datadir value from the env var PGDATA in service configuration file.
If the PGDATA env var is not defined in the service file, the program falls back to the default value /var/lib/pgsql/data .
There exists the env var PGSETUP_INITDB_OPTIONS that one can use to provide additionnal initdb options but even if we fill the env var PGSETUP_INITDB_OPTIONS with the datadir, the postgresql-XX-setup program under the hood passes the datadir option with the value extracted from the service file before passing the value of the env var PGSETUP_INITDB_OPTIONS. Therefore the only way to override the datadir is to do so in the service file, the reload systemd and run the postgresql-XX-setup initdb program. I don't like that
And even then, I've found that the command doesn't seem to be very consistent in either initializing the cluster or outputing errors for when it doesnt initialize the cluster.
Usually the program will output this withtout actually initializing the datadir.
The text was updated successfully, but these errors were encountered:
While initializing the database cluster on redhat with the program
postgresql-XX-setup
, it seems to retrieve the datadir value from the env varPGDATA
in service configuration file.If the
PGDATA
env var is not defined in the service file, the program falls back to the default value/var/lib/pgsql/data
.There exists the env var
PGSETUP_INITDB_OPTIONS
that one can use to provide additionnal initdb options but even if we fill the env varPGSETUP_INITDB_OPTIONS
with the datadir, thepostgresql-XX-setup
program under the hood passes the datadir option with the value extracted from the service file before passing the value of the env varPGSETUP_INITDB_OPTIONS
. Therefore the only way to override the datadir is to do so in the service file, the reload systemd and run thepostgresql-XX-setup initdb
program. I don't like thatAnd even then, I've found that the command doesn't seem to be very consistent in either initializing the cluster or outputing errors for when it doesnt initialize the cluster.
Usually the program will output this withtout actually initializing the datadir.
The text was updated successfully, but these errors were encountered: