Closed shailabsinghha closed 4 months ago
You can define the Postgres parameters in the postgresql_parameters variable.
There is a postgresql.conf
file in /var/lib/postgresql/15/main
location. I would like to add a custom parameter here such that it can be picked from current_setting
something like select current_setting('encrypt.key');
. I think that patronictl showconfig
and postgresql.conf
are different.
What I have tried so far to achieve this with this project
select pg_reload_conf()
in master nodesystemctl restart postgresql
Nothing worked so far. Am I missing something here?
1) change the parameters in the postgresql_parameters
variable. You can also specify the pending_restart: true
variable so that Postgres is automatically restarted if a parameter change requires a restart.
2) run config_pgcluster.yml
playbook to apply changes.
@shailabsinghha The encrypt.key
parameter is not a standard PostgreSQL setting and is not mentioned in the official PostgreSQL documentation. Is this most likely related to some kind of third-party extension?
To change the Postgres configuration in a cluster using automation:
- change the parameters in the
postgresql_parameters
variable. You can also specify thepending_restart: true
variable so that Postgres is automatically restarted if a parameter change requires a restart.- run
config_pgcluster.yml
playbook to apply changes.
This worked. Prompt response is appreciated 🙌
@shailabsinghha The
encrypt.key
parameter is not a standard PostgreSQL setting and is not mentioned in the official PostgreSQL documentation. Is this most likely related to some kind of third-party extension?
encrypt.key
is a custom parameter which I was using in my project. It is not related to any PostgreSQL Official config parameters or third party extension
To change the Postgres configuration in a cluster using automation:
- change the parameters in the
postgresql_parameters
variable. You can also specify thepending_restart: true
variable so that Postgres is automatically restarted if a parameter change requires a restart.- run
config_pgcluster.yml
playbook to apply changes.This worked. Prompt response is appreciated 🙌
I want to use some global current_setting params in the db for some of my use cases. I would like it to be part of the configuration. How can we achieve that? I can see the. main.yml parameters change the pgbouncer configuration however I could not find any reference to postgresql.conf file parameters or options as such. Prompt answers will be much appreciated!
Please find a sample query for getting the custom-added field
select current_setting('encrypt.key');