Thanks for your reply.

I can start the database like this: pg_ctl start -D /hostname/postgres/data -l 
/hostname/postgres/log

My data directory has the following file:
postgres.cnf

Content of the postgres.cnf contains only 1 line:
include /nfs/global/postgres-<hostname>.cnf

Question:
Can <hostname> be a variable like `hostname` derived from Unix shell or I have 
to hardcode the name of the host like " include /nfs/global/postgres-host123.cnf

-----Original Message-----
From: Tom Lane [mailto:t...@sss.pgh.pa.us]
Sent: Tuesday, July 31, 2018 9:52 AM
To: Lu, Dan <dan...@msx.bala.susq.com>
Cc: David G. Johnston <david.g.johns...@gmail.com>; Alvaro Aguayo Garcia-Rada 
<aagu...@opensysperu.com>; pgsql-gene...@postgresql.org
Subject: Re: Question on postgresql.conf

"Lu, Dan" <dan...@sig.com> writes:
> Say, I want to put the config file on a share drive so all my postgres 
> configuration file can be seen in one location.
> /nfs/global/postgres-<hostname>.cnf

What I'd do is make each data directory's postgresql.conf contain just this:

include /nfs/global/postgres-<hostname>.cnf

and then just start the postmaster without any weird switches.
In this way you will avoid breaking PG-specific tools that expect to find the 
config file at its standard location.

regards, tom lane

________________________________

IMPORTANT: The information contained in this email and/or its attachments is 
confidential. If you are not the intended recipient, please notify the sender 
immediately by reply and immediately delete this message and all its 
attachments. Any review, use, reproduction, disclosure or dissemination of this 
message or any attachment by an unintended recipient is strictly prohibited. 
Neither this message nor any attachment is intended as or should be construed 
as an offer, solicitation or recommendation to buy or sell any security or 
other financial instrument. Neither the sender, his or her employer nor any of 
their respective affiliates makes any warranties as to the completeness or 
accuracy of any of the information contained herein or that this message or any 
of its attachments is free of viruses.

Reply via email to