I am trying to enable the transaction logs in PostgreSQL, where query run time is more than 3 seconds, by setting this flag
log_min_duration_statement = 3000
How to reload the configuration file without restarting the Postgres?
I've tried the below options and got these errors
1) postgres=# select pg_reload_config();
**ERROR: function pg_reload_config() does not exist**
LINE 1: select pg_reload_config();
2) postgres@ospostgresql:/$ /usr/lib/postgresql/11/bin/pg_ctl reload
pg_ctl: no database directory specified and environment variable PGDATA unset
Try "pg_ctl --help" for more information.
1) postgres=# select pg_reload_conf();
2)
1) su postgres
2) /usr/lib/postgresql/11/bin/pg_ctl -D /var/lib/postgresql/11/main reload
Incorrect:
select pg_reload_config();
**ERROR: function pg_reload_config() does not exist**
**-->** This is resolved by giving correct function name
postgres@ospostgresql:/$ /usr/lib/postgresql/11/bin/pg_ctl reload
pg_ctl: no database directory specified and environment variable PGDATA unset
Try "pg_ctl --help" for more information.
**-->** This error is resolved by changing the user to postgres
Thank you @a_horse_with_no_name in helping to identify the typo which causes issue-1
Please use:
SELECT pg_reload_conf();
Or simply:
postgres@server:$ psql -c "SELECT pg_reload_conf()"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With