Re: Parsing config files in a directory

From: Greg Smith <gsmith(at)gregsmith(dot)com>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
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-24 17:32:26
Message-ID: alpine.GSO.2.01.0910241314280.21964@westnet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, 24 Oct 2009, Andrew Dunstan wrote:

> If we're going to do this at all, ISTM the location should be configurable,
> just like other file locations are.
> ...
> What bothers me some is that it sounds like a bit of a footgun. A postgres
> cluster is a shared resource, and we surely don't want applications meddling
> with the shared config. This seems quite different from, say, an application
> dropping a file in /etc/cron.d.

It's hard to satisfy both these at once. If you want to make it secured
against random application changes, the logical default place to put the
files is in the database directory itself. If apps are allowed to write
there, they can surely cause more mayhem them just overwriting the config
files. If instead you allow the files to go anywhere, that's more
flexible, but then requires you to make sure that alternate location is
similarly secured.

Regardless, the UI I was hoping for was to make the default
postgresql.conf file end with a line like this:

directory 'conf'

Which makes the inclusion explicit for people used to navigating the
current style: look for a "conf" directory under PGDATA, those have the
modifications you're looking for. That's also easy for distributors to
patch, so you might even have the RHEL build ship with something like:

directory '/etc/sysconfig/postgresql/config'

I don't think it's asking too much of tool authors that given a PGDATA,
they would need to parse the postgresql.conf file in there just well
enough to figure out where the directory(s) of additional config files is
at. That level of config file manipulation there's already code for in
initdb, I was planning to refactor that into a library I can include for
the built-in pgtune I've been planning.

--
* Greg Smith gsmith(at)gregsmith(dot)com http://www.gregsmith.com Baltimore, MD

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2009-10-24 17:44:14 PostgreSQL 8.5alpha2 Now Available
Previous Message Roger Leigh 2009-10-24 17:23:24 Re: Unicode UTF-8 table formatting for psql text output