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

don't set data_directory in the config by default #1576

Open
evgeni opened this issue Feb 21, 2024 · 0 comments · May be fixed by #1577
Open

don't set data_directory in the config by default #1576

evgeni opened this issue Feb 21, 2024 · 0 comments · May be fixed by #1577

Comments

@evgeni
Copy link
Contributor

evgeni commented Feb 21, 2024

Describe the Bug

Today, we always set data_directory = … in postgresql.conf via

postgresql::server::config_entry { "data_directory_for_instance_${name}":
key => 'data_directory',
value => $datadir,
}

However we also set it in the systemd override:

content => epp('postgresql/systemd-override.conf.epp', {
port => $port,
datadir => $datadir,
extra_systemd_config => $extra_systemd_config,
}
),

Environment=PGDATA=<%= $datadir %>

And pass it when calling initdb:

$datadir_parameter = "--pgdata '${datadir}'"

The problem is that setting data_directory in the config actually overrides the -D parameter on the CLI and the PGDATA environment variable, as can be seen in e.g. https://bugzilla.redhat.com/show_bug.cgi?id=1935301 thus possibly breaking future actions against this DB (see the link for an example, also https://www.postgresql.org/message-id/3566642.1618422939%40sss.pgh.pa.us).

Expected Behavior

data_directory not set in postgresql.conf when systemd is used and thus the environment variable is present

Steps to Reproduce

install a postgresql setup :)

Environment

  • Version 10.0.3
  • Platform CentOS Stream 8

Additional Context

This is the exact opposite of #510 🤷‍♀️

evgeni added a commit to evgeni/puppetlabs-postgresql that referenced this issue Feb 21, 2024
@evgeni evgeni linked a pull request Feb 21, 2024 that will close this issue
5 tasks
evgeni added a commit to evgeni/puppetlabs-postgresql that referenced this issue Feb 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants