Re: About the pid and opts files - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: About the pid and opts files
Date
Msg-id Pine.LNX.4.21.0006251648080.11966-100000@localhost.localdomain
Whole thread Raw
In response to Re: About the pid and opts files  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: About the pid and opts files
List pgsql-hackers
Tom Lane writes:

> PGDATESTYLE/TZ are not dangerous as far as I know; it should be
> allowed for the user to change these.

But in the context of pg_ctl we should certainly ensure that the old value
gets carried over unless overridden. We could make the postmaster.opts
file look like this:

PGDATESTYLE=${PGDATESTYLE-oldvalue} TZ=${TZ-oldvalue} ... postmaster ...

But I'm not sure if that is safe enough. If you want to change the
environment you can either edit postmaster.opts or do an explicit
stop/start rather than restart.

Failure scenario: Normally, TZ is unset. I log in remotely from a
different time zone to administer a database server so I have TZ set to
override the system's default time zone. I `su postgres', do something,
pg_ctl restart. All the sudden the server operates with a different
default time zone. This is not an unrealistic situation, I have done this
many times. If pg_ctl wants to automate things then it shouldn't be
subject to these sort of failures if possible.

-- 
Peter Eisentraut                  Sernanders väg 10:115
peter_e@gmx.net                   75262 Uppsala
http://yi.org/peter-e/            Sweden



pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: Re: Call for port testing on fmgr changes -- Results!
Next
From: Peter Eisentraut
Date:
Subject: Re: CLASSOID patch