Same Question as this: How to edit postgresql.conf
with pgAdmin 3? but updated for the completely new (total re-write) pgAdmin 4.
➥ How does one edit the configuration files with the pgAdmin 4 app?
- postgresql.conf
- pg_hba.conf
I added the adminpack extension as discussed here. And I restarted pgAdmin 4. Yet I cannot identify any menu item or other interface item for editing this files.
Best Answer
Workaround:
ALTER SYSTEM
As a partial workaround, Postgres 9.4 added a feature to dynamically set the properties seen in
postgresql.conf
:ALTER SYSTEM
commands.This provides a convenient alternative to manually editing the
postgresql.conf
file.Example:
How does it work?
postgresql.auto.conf
file is written by theALTER SYSTEM SET
command.postgresql.conf
are both read, so you can combine these approaches if desired. Theauto
file trumps the hand-edited file for coinciding properties.postgresql.auto.conf.temp
file is created to rollback to the original state in case of error.Caveats:
data_directory
.Tip: To read the value of the settings, see this Question, Query for all the Postgres configuration parameters‘ current values?
Workaround: Use command-line editor as
postgres
userYou can run a simple text-editor like nano from the command-line run with the privileges of the
postgres
user. Open thepg_hba.conf
file, edit, and save.For example, on a Unix/POSIX-oriented OS such as BSD or macOS:
For more info, see the Question, Switch user to 'postgres' user on macOS results in “su: Sorry” error