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

programmatic interface to set pg config #73

Closed
JimFuller-RedHat opened this issue Jun 12, 2024 · 4 comments
Closed

programmatic interface to set pg config #73

JimFuller-RedHat opened this issue Jun 12, 2024 · 4 comments
Labels
enhancement New feature or request

Comments

@JimFuller-RedHat
Copy link

JimFuller-RedHat commented Jun 12, 2024

We would like to configure postgres with startup configurations, for example

shared_preload_libraries = 'pg_stat_statements

this can be achieved today by manually editing generated postgres.conf (and restart to pick up the change)... or I guess subsequent ALTER setting config (on non postmaster pg configs) or maybe we can do this today with pg_ctl reload (which I think is already supported here) ... will research.

Probably (optionally) pass a HashMap into the function and then process around

let options = format!("-F -p {}", self.settings.port);

maybe its possible to chain .options() so we can just add '-c shared_preload_libraries='pg_stat_statements' string ... though I do not know if the current pg config builder is aware enough or if we have to munge strings direct here.

alternately we could support PG native env vars (ex. PGDATA) to control this. Maybe this already works if we start up in default without passing in any settings ... will research.

The end goal is to start a pg with custom pg configurations.

@brianheineman brianheineman added the enhancement New feature or request label Jun 14, 2024
@brianheineman
Copy link
Contributor

Hello @JimFuller-RedHat, thank you for the feature request. From the description, it sounds like you are planning on spending some more time researching this. I put together the start of something that may meet your needs; would you mind taking a look at #74 and letting me know what your thoughts are?

@JimFuller-RedHat
Copy link
Author

addresses perfectly ... thx ... maybe next time I will raise a PR (you were very fast!).

@brianheineman
Copy link
Contributor

Please feel free to submit PRs if there are any changes / improvements you would like to see in the project

@brianheineman
Copy link
Contributor

The changes for #74 have been released in version 0.10.1

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

No branches or pull requests

2 participants