I want to modify a postgresql.conf parameter through the shell. From the documentation I can see that I can use the postgres command with the -c flag.
However, on my attempt, for example,
postgres -c autovacuum=off
postgres returns:
Execution of PostgreSQL by a user with administrative permissions is not permitted.
The server must be started under an unprivileged user ID to prevent possible system security compromises. See the documentation for more information on how to properly start the server.
How can I overcome this or what is the correct procedure? Also, I don't really mind for security compromises.
postgres -c foo=bar(when it works) doesn't update postgresql.conf -- instead, it starts the postgres server, withfoooverridden to have the valuebaronly that one time the server is started (but leavingfooat its normal value in the ongoing configuration for future invocations).echo, or usesedto rewrite it. Or enable aninclude_fileorinclude_directoryand write new parameters there. Or useALTER SYSTEM SET.