RE: Question on postgresql.conf

From: "Lu, Dan" <Dan(dot)Lu(at)sig(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, "Alvaro Aguayo Garcia-Rada" <aaguayo(at)opensysperu(dot)com>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: RE: Question on postgresql.conf
Date: 2018-07-31 13:59:43
Message-ID: ffd0c58838c44259b7c83e86256c4677@msx.bala.susq.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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:tgl(at)sss(dot)pgh(dot)pa(dot)us]
Sent: Tuesday, July 31, 2018 9:52 AM
To: Lu, Dan <Dan(dot)Lu(at)msx(dot)bala(dot)susq(dot)com>
Cc: David G. Johnston <david(dot)g(dot)johnston(at)gmail(dot)com>; Alvaro Aguayo Garcia-Rada <aaguayo(at)opensysperu(dot)com>; pgsql-general(at)postgresql(dot)org
Subject: Re: Question on postgresql.conf

"Lu, Dan" <Dan(dot)Lu(at)sig(dot)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.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2018-07-31 14:21:33 Re: Question on postgresql.conf
Previous Message Adrian Klaver 2018-07-31 13:53:32 Re: Design of a database table