Thread: [GENERAL] starting PG command line options vs postgresql.con

[GENERAL] starting PG command line options vs postgresql.con

From
rakeshkumar464
Date:
I am new to Docker env and I see that PG, as a container is started with
parameters like this:
docker run -it \
--detach \
--name name \
--restart=unless-stopped \
-p 5432:5432 \

-e PGDATA=/var/lib/postgresql/data/pg10 
-N 500 \
-B 3GB \
-S 6291kB \
-c listen_addresses=* \
-c effective_cache_size=9GB \
-c maintenance_work_mem=768MB \
-c min_wal_size=2GB \
-c max_wal_size=4GB \

I would prefer using postgresql.conf.  what is the consensus in this forum
regarding command line vs postgresql.conf.  Also if conflicting, which one
takes priority.

thanks



--
Sent from: http://www.postgresql-archive.org/PostgreSQL-general-f1843780.html


-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Re: [GENERAL] starting PG command line options vs postgresql.con

From
Tom Lane
Date:
rakeshkumar464 <rakeshkumar464@outlook.com> writes:
> I am new to Docker env and I see that PG, as a container is started with
> [ lots of command-line parameters ]

> I would prefer using postgresql.conf.  what is the consensus in this forum
> regarding command line vs postgresql.conf.  Also if conflicting, which one
> takes priority.

The command line takes priority, IIRC, which means that nothing set on
the command line can be overridden without a restart.

I like to specify -p on the command line so that it's easy to tell which
postmaster is which in "ps" listings (of course, this only matters if
you're running multiple postmasters).  Otherwise it's better to leave
as much as you can to postgresql.conf.
        regards, tom lane


-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Re: [GENERAL] starting PG command line options vs postgresql.con

From
"David G. Johnston"
Date:
On Mon, Oct 30, 2017 at 6:48 AM, rakeshkumar464 <rakeshkumar464@outlook.com> wrote:
I would prefer using postgresql.conf.  what is the consensus in this forum
regarding command line vs postgresql.conf. 

​I suspect that most people administering a PostgreSQL database would expect that the configuration file would be changed in lieu of passing options via the command line.

Also if conflicting, which one
takes priority.


David J.

Re: [GENERAL] starting PG command line options vs postgresql.con

From
Michael Paquier
Date:
On Mon, Oct 30, 2017 at 2:08 PM, David G. Johnston
<david.g.johnston@gmail.com> wrote:
> On Mon, Oct 30, 2017 at 6:48 AM, rakeshkumar464 <rakeshkumar464@outlook.com>
> wrote:
>>
>> I would prefer using postgresql.conf.  what is the consensus in this forum
>> regarding command line vs postgresql.conf.
>
> I suspect that most people administering a PostgreSQL database would expect
> that the configuration file would be changed in lieu of passing options via
> the command line.

Disagreement here. For one, it makes pg_upgrade more complicated
because it would need to track and then rewrite postgresql.conf, or
just copy it temporarily. The current way of doing things gives the
best of both worlds.
-- 
Michael


-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general