Re: [GENERAL] pg_hba.conf directory?

2012-11-08 Thread Craig Ringer
On 11/09/2012 04:49 AM, Matt Zagrabelny wrote:
> Hello,
>
> I've searched the mailing list archives and google regarding using a
> directory to contain pg_hba.conf snippets. Does such a feature exist
> for any version of PG?
Oh, by the way; proposals are currently being discussed on pgsql-hackers
about making it possible to modify postgresql.conf via SQL commands.
This might be a good time to mention your interest in supporting a
snippet directory. See the thread by Amit Kapila subject "Proposal for
Allow postgresql.conf values to be changed via SQL".

--
Craig Ringer


-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] pg_hba.conf directory?

2012-11-08 Thread Craig Ringer
On 11/09/2012 04:49 AM, Matt Zagrabelny wrote:
> Hello,
>
> I've searched the mailing list archives and google regarding using a
> directory to contain pg_hba.conf snippets. Does such a feature exist
> for any version of PG?
If I understand you correctly, you want a `pg_hba.conf.d` where
PostgreSQL reads every file in `pg_hba.conf.d` in alphabetical order and
concatenates it to the contents of `pg_hba.conf`? So effectively you can
create a `pg_hba.conf` from a bunch of small files?

If so: No, there is no such feature in PostgreSQL. You might be able to
come up with a convincing argument for the creation of one, especially
if you made it generic enough that it also worked for postgresql.conf,
but you probably won't get enough interest for someone else to write it.
If you want the feature you'll probably need to write it yourself -
after asking on pgsql-hackers to make sure there are no objections to
the idea and that your design is reasonable.


What you CAN do is simulate the feature using init scripts. Have your
PostgreSQL start/stop scripts do something like:

cat pg_hba.conf.head pg_hba.conf.d/* pg_hba.conf.tail > pg_hba.conf

(Note that the glob will sort alphabetically at least in bash; see
http://superuser.com/questions/192280/does-bashs-match-files-in-alphanumeric-order)

Make sure to put prominent comments in pg_hba.conf.head and
pg_hba.conf.tail that explain that pg_hba.conf is a generated file, so
people don't edit it then wonder why it's overwritten.

You'll need to provide a "reload" command that rewrites pg_hba.conf and
then signals PostgreSQL to reload or uses pg_ctl reload, as well as the
usual start and stop commands.

--
Craig Ringer


[GENERAL] pg_hba.conf directory?

2012-11-08 Thread Matt Zagrabelny
Hello,

I've searched the mailing list archives and google regarding using a
directory to contain pg_hba.conf snippets. Does such a feature exist
for any version of PG?

Would this be a better question for a pg dev mailing list?

Please Cc me, I am not (yet) subscribed to the list.

Thanks!

-Matt Zagrabelny


-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general