Skip site navigation (1) Skip section navigation (2)

Re: Parsing config files in a directory

From: Greg Stark <gsstark(at)mit(dot)edu>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Magnus Hagander <magnus(at)hagander(dot)net>, Simon Riggs <simon(at)2ndquadrant(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Parsing config files in a directory
Date: 2009-10-26 18:15:06
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
On Sat, Oct 24, 2009 at 6:55 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> I think we should have an explicit include-directory directive, and the
> reason I think so is that it makes it fairly easy for the user to
> control the relative precedence of the manual settings (presumed to
> still be kept in postgresql.conf) and the automatic settings (presumed
> to be in files in the directory).  Manual settings before the include
> are overridable, those after are not.

I think we can actually aim higher now. We don't need nearly as many
degrees of freedom as people seem to be suggesting. And in this space
degrees of freedom just mean the ability to have confusing
configurations that surprise users.

I would suggest the following:

The system always scans postgresql.conf and postgresql.conf.d in the
same location. We can support include and includedir directives though
I think they would be mostly unnecessary. But they would be purely for
the purpose of organizing your files and adding additional locations,
not replacing the standard locations. They might be useful for, for
example, having a site-wide set of defaults which are loaded before
the cluster-specific files.

postgresql.conf settings override postgresql.conf.d settings.
postgresql.conf should no longer be a place for tools to automatically
edit, and ideally it should be shipped empty so anything there is an
explicit manual instruction from a sysadmin and should override
anything installed by a package or tool.

When scanning postgresql.conf.d we should follow the  Apache/Debian
standard of scanning only files which match a single simple hard-coded
template. I think the convention is basically the regexp
^[0-9a-zA-Z-]*.conf$. It's important that it exclude typical backup
file conventions like foo~  or foo.bak and lock file conventions like
.#foo. There's no need for this to be configurable and I think that
would be actively harmful.


In response to


pgsql-hackers by date

Next:From: Greg StarkDate: 2009-10-26 18:34:04
Subject: Re: Parsing config files in a directory
Previous:From: Tom LaneDate: 2009-10-26 18:01:57
Subject: Re: Endgame for all those SELECT FOR UPDATE changes: fix plan node order

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group