[FEATURE REQUEST] Add parameter with explicit Postgres bindir for various postgres states #67568
dkacar-oradian
started this conversation in
Feature Requests
Replies: 1 comment
|
@dkacar-oradian your explanation makes sense. Thank you for the feature request. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Is your feature request related to a problem? Please describe.
Various Postgres states (like
postgres_initdb.present) requirepostgres.bins_dirconfiguration directive to be set. That's OK because that's the path where they can find command line utilities they need (likepsqlorinitdb) to do the job.It isn't OK that this value is retreived by
config.optiononly because that disables the possibility of having different Postgres versions installed on the same OS. Having different versions is rather important because it is a very common scenario. There is usually one DB version per OS on a machine which is usually referred to as a "production database server" and this is where such feature isn't important. But all supporting databases need to have the ability to run multiple versions.Supporting databases examples (that I actually have):
pg_dumpfrom the production database server. Used to generate data dumps for customers (they call it backups).The need for different versions on the support servers comes because of the upgrade procedure for the production database servers. If you have more than one production DB server then it's wise to upgrade them one by one and leave some time (days) between upgrades to resolve problems if they appear. That way the problems won't hit all customers at once and we won't be swamped with support requests.
During the production database upgrade time all support database servers must have multiple Postgres versions installed and running. That can go on like that for days or weeks.
Production database server (with only one Postgres version per OS) is basically an anomaly. But there is only one such anomaly, as far as server configuration is concerned. But there are multiple types of supporting servers and each of them needs its own Salt configuration.
I just want a normal way to maintain multiple Postgres versions with Salt.
Describe the solution you'd like
To each Postgres state which is currently checking
postgres.bins_dirconfiguration option add an explicit parameter which could contain that value. If the parameter is not specified then fall back to the current method of obtaining it.For example (if you call that additional parameter
bins_dir):Describe alternatives you've considered
It is possible to work around this problem because grain can be used to set
postgres.bins_dirvalue, but that's really not the greatest way. For example, I'm currently using this for one of the servers mentioned above:That works, but it's clunky. And the
unlessclause forgrains.presentis particularly frustrating. It has to reimplement the main state's (herepostgres_initdb.present) functionality which checks if there's a need for changes. The above code will work for Postgres versions starting from 10, I think. Older versions had a slightly different utility name, so I'd actually have to write a script to check that properly. Furtunately, I have no need for Postgres versions which are older than 10, so I can get away with what I wrote above.But I'm illustrating that reimplementing that functionality isn't easy and since it already exists in your Python code I'd really like to be able to use it instead of having to write my own in a shell one-liner.
Additional context
Add any other context or screenshots about the feature request here.
Please Note
If this feature request would be considered a substantial change or addition, this should go through a SEP process here https://github.com/saltstack/salt-enhancement-proposals, instead of a feature request.
All reactions