Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Comments

@davidassigbi
Copy link
Contributor

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.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant