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

From Tom Lane
Subject Re: About the pid and opts files
Date
Msg-id 22109.961900039@sss.pgh.pa.us
Whole thread Raw
In response to Re: About the pid and opts files  (Peter Eisentraut <peter_e@gmx.net>)
Responses Re: About the pid and opts files
List pgsql-hackers
Peter Eisentraut <peter_e@gmx.net> writes:
> It occurred to me, we really do need to save the environment of the
> postmaster. Consider such variables as LANG, LC_*, PATH (to find
> executable), PGPORT, PGDATESTYLE, TZ.

Particularly the locale-related env vars.  I think it is a serious
bug in the current system that it is possible to start the postmaster
with locale vars different from the values in effect at initdb time.
You can corrupt your text-column indices completely that way, because
the sort ordering an index depends on can change from run to run.

(We've only seen one or two bug reports we could trace to this, AFAIR,
but I'm surprised we don't see a steady stream of 'em.  It's just too
easy to screw up if you sometimes start your postmaster from an
interactive environment and sometimes from system boot scripts.)

An opts file is not a reliable solution --- initdb ought to be recording
all the locale-relevant variables in pg_control, or some such NON user
editable place, and postmaster or backend startup ought to force those
values to be re-adopted.

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


pgsql-hackers by date:

Previous
From: Lamar Owen
Date:
Subject: Re: Interesting mention of PostgreSQL in news
Next
From: Tatsuo Ishii
Date:
Subject: Re: Re: Call for port testing on fmgr changes -- Results!