I have added the option of explicitly specifying a postgresql.conf (-C) file on
the command line. I have also added two config file entries:

pghbaconfig, and pgdatadir.

"pghbaconfig" allows multiple different databases running on the same machine
to use the same hba file, rather than the hard coded $PGDATA/pg_hba.conf.

"pgdatadir" works with the explicit configuration file so that the data
directory can be specified in the configuration file, not on the command line
or environment.

One can start postgres as:

postmaster -C /etc/pgsql/mydb1.conf 

Postgres will get all its required information from "mydb1.conf."

Does anyone see any value to these mods? I wanted to be able to run multiple
PostgreSQL instances on the same machine, and having the ability to keep these
control files in a central location and share the HBA control files between
databases may be helpful for admins. It will certainly make my life easier.
Sat, 08 Dec 2001 10:58:42 -0500
mlw <markw@mohawksoft.com>
Explicit configuration file
> Does anyone see any value to these mods? I wanted to be able to run multiple
> PostgreSQL instances on the same machine, and having the ability to keep these
> control files in a central location and share the HBA control files between
> databases may be helpful for admins. It will certainly make my life
easier.

Isn't it easier to just use symlinks?

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

Mon, 10 Dec 2001 06:04:52 -0500 (EST)
Bruce Momjian <pgman@candle.pha.pa.us>
Re: Explicit configuration file
Bruce Momjian wrote:
> 
> > Does anyone see any value to these mods? I wanted to be able to run multiple
> > PostgreSQL instances on the same machine, and having the ability to keep these
> > control files in a central location and share the HBA control files between
> > databases may be helpful for admins. It will certainly make my life
> easier.
> 
> Isn't it easier to just use symlinks?
> 

There is a sort of chicken and egg poblem with PostgreSQL administration. Since
the settings are not in the "etc" directory, you need to know where PostgreSQL
is installed before you can administer it. If you have multiple systems,
configured differently, you have to hunt around to find your PostgreSQL
directory on the machine on which you are working.

We use a "push" system to push out a whole PostgreSQL data directory to
multiple boxes. It would be good to be able to specify default configuration
differences between the master the slaves without having to edit the snap shot.

At our site, all the configuration files are in a centralized directory and
under CVS, except one. Guess which.

Symlinks don't copy well via ssh.

Having the configuration files outside a standard directory, ala "/etc" is not
very UNIX like. 

I could run: 
	initdb -D/u01/pgsql 
	su pgsql -c "postgresql -C /etc/pgsql/mydb.conf"

And get all the settings I specify without having to copy files.

I could go on, and they are all just nit-picks to be sure, but it just seems
"cleaner" to be able to put the configuration in a separate place than the
data.

Mon, 10 Dec 2001 07:29:09 -0500
mlw <markw@mohawksoft.com>
Re: Explicit configuration file
mlw wrote:
> 
> Bruce Momjian wrote:
> >
> > > Does anyone see any value to these mods? I wanted to be able to run multiple
> > > PostgreSQL instances on the same machine, and having the ability to keep these
> > > control files in a central location and share the HBA control files between
> > > databases may be helpful for admins. It will certainly make my life
> > easier.
> >
> > Isn't it easier to just use symlinks?
> >
> 
> There is a sort of chicken and egg poblem with PostgreSQL administration. Since
> the settings are not in the "etc" directory, you need to know where PostgreSQL
> is installed before you can administer it. If you have multiple systems,
> configured differently, you have to hunt around to find your PostgreSQL
> directory on the machine on which you are working.
> 
> We use a "push" system to push out a whole PostgreSQL data directory to
> multiple boxes. It would be good to be able to specify default configuration
> differences between the master the slaves without having to edit the snap shot.
> 
> At our site, all the configuration files are in a centralized directory and
> under CVS, except one. Guess which.
> 
> Symlinks don't copy well via ssh.
> 
> Having the configuration files outside a standard directory, ala "/etc" is not
> very UNIX like.
> 
> I could run:
>         initdb -D/u01/pgsql
>         su pgsql -c "postgresql -C /etc/pgsql/mydb.conf"
> 
> And get all the settings I specify without having to copy files.
> 
> I could go on, and they are all just nit-picks to be sure, but it just seems
> "cleaner" to be able to put the configuration in a separate place than the
> data.

Perhaps, even use the standard GNU configure "sysconfigdir" setting to point to
postgresql.conf, as well as pg_hba.conf. i.e. "$sysconfigdir/postgresql.conf.
That should be easy enough, and hat would bring PostgreSQL in line with many of
the common practices.

Mon, 10 Dec 2001 08:05:35 -0500
mlw <markw@mohawksoft.com>
Re: Explicit configuration file
mlw writes:

> I have added the option of explicitly specifying a postgresql.conf (-C) file on
> the command line. I have also added two config file entries:
>
> pghbaconfig, and pgdatadir.
>
> "pghbaconfig" allows multiple different databases running on the same machine
> to use the same hba file, rather than the hard coded $PGDATA/pg_hba.conf.

That could be mildly useful, although symlinks make this already possible,
and a bit clearer, IMHO.

> "pgdatadir" works with the explicit configuration file so that the data
> directory can be specified in the configuration file, not on the command line
> or environment.

So you exchange having to specify the data directory with having to
specify the configuration file which specifies the data directory.  This
doesn't add any functionality, it only adds one more indirection.

-- 
Peter Eisentraut   peter_e@gmx.net


Mon, 10 Dec 2001 14:07:44 +0100 (CET)
Peter Eisentraut <peter_e@gmx.net>
Re: Explicit configuration file
Peter Eisentraut wrote:
> 
> mlw writes:
> 
> > I have added the option of explicitly specifying a postgresql.conf (-C) file on
> > the command line. I have also added two config file entries:
> >
> > pghbaconfig, and pgdatadir.
> >
> > "pghbaconfig" allows multiple different databases running on the same machine
> > to use the same hba file, rather than the hard coded $PGDATA/pg_hba.conf.
> 
> That could be mildly useful, although symlinks make this already possible,
> and a bit clearer, IMHO.

On systems which support symlinks, yes. 

Also, a system should be "self documenting" i.e. one should be able to put
clues to why certain things were done. Symlinks allow one to do something, yes,
but if I leave the company, someone besides me should be able to administrate
the system I leave behind. 

Don't you consider symlinks as a kind of a hack around a basic flaw in the
configuration process? Shouldn't the configuration file let you completely
specify how your system is configured? 


> 
> > "pgdatadir" works with the explicit configuration file so that the data
> > directory can be specified in the configuration file, not on the command line
> > or environment.
> 
> So you exchange having to specify the data directory with having to
> specify the configuration file which specifies the data directory.  This
> doesn't add any functionality, it only adds one more indirection.

Yes and no. There is an underlying methodology to most unix server programs,
the configuration information goes in one place, and the data is in another.
For people used to PostgreSQL, I don't think they see how alien it is to people
that know how to admin UNIX, but not Postgres.

Think about named, sendmail, apache, dhcpd, sshd, etc. All these programs have
the notion that he configuration is separate from the working data. To see how
they are configured, you just go to the "/etc" or "/etc/pgsql" directory and
read the configuration file(s).

With postgres, you need to know where, and go to the data directory, as ROOT
(or the pg user) because you can't enter it otherwise, look at postgresql.conf,
do an "ls -l" to see which parts are symlinked and which are not. If you have
multiple PostgreSQL installations, you have to go to each directory and repeat
the process. (hyperbole, I know)

I just posted a reply to a message from Bruce, and in it I theorized that,
maybe, even "sysconfigdir" could point to where postgresql.conf would be
located by default.

I am not suggesting we change the default behavior of PostgreSQL, I am merely
suggesting that adding these features may make it more comfortable for the UNIX
admin.

Mon, 10 Dec 2001 08:31:59 -0500
mlw <markw@mohawksoft.com>
Re: Explicit configuration file
...
> I am not suggesting we change the default behavior of PostgreSQL, I am merely
> suggesting that adding these features may make it more comfortable for the UNIX
> admin.

istm to be a useful addition. Symlinks are not a substitute for a
configurable system, for the reasons Mark brought up.

                    - Thomas

Mon, 10 Dec 2001 16:24:25 +0000
Thomas Lockhart <lockhart@fourpalms.org>
Re: Explicit configuration file
mlw writes:

> > That could be mildly useful, although symlinks make this already possible,
> > and a bit clearer, IMHO.
>
> On systems which support symlinks, yes.

All systems that are able to run PostgreSQL support symlinks.

Really.

> Also, a system should be "self documenting" i.e. one should be able to put
> clues to why certain things were done. Symlinks allow one to do something, yes,
> but if I leave the company, someone besides me should be able to administrate
> the system I leave behind.
>
> Don't you consider symlinks as a kind of a hack around a basic flaw in the
> configuration process?

Elsewhere you stated that a certain aspect of the current situation is not
very Unix-like.  Well, symlinks are very Unix-like.  They have been
invented exactly for the purpose of sharing files for several purposes,
while maintaining the identity of the "original" (else use hard links).
They are not hacks, they can be nested and used recursively, they are
self-documenting and they don't prevent you from adding your own
documentation either.  I don't want to be adding a new feature anytime
someone doesn't like the tools the operating system already provides.

> Shouldn't the configuration file let you completely specify how your
> system is configured?

Sure, it specifies how the PostgreSQL server behaves.  It is not concerned
with telling your operating system how to behave.

> Think about named, sendmail, apache, dhcpd, sshd, etc. All these programs have
> the notion that he configuration is separate from the working data. To see how
> they are configured, you just go to the "/etc" or "/etc/pgsql" directory and
> read the configuration file(s).

named: Configuration and data files are both under /var/named.

sendmail: is not a suitable example for a well-designed, easy-to-use
software system.

apache: Does not easily allow running multiple instances on one host.
The virtual host setups I've seen put both configuration and data files
under the same per-host directory.  Imagine what a mess it would be
otherwise.

dhcpd, sshd: Only one instance per host supported/necessary.

Ironically, if sendmail hadn't the bear it is, my former employer would
never have switched to a certain alternative MTA and I would never have
gotten the inspiration for creating the postgresql.conf file the way it is
today.

> With postgres, you need to know where, and go to the data directory, as ROOT
> (or the pg user) because you can't enter it otherwise, look at postgresql.conf,

Other users don't have a business reading that file.  That's a feature.

> do an "ls -l" to see which parts are symlinked and which are not. If you have
> multiple PostgreSQL installations, you have to go to each directory and repeat
> the process. (hyperbole, I know)

The alternative is that you have to scan the startup code for each server
(where would that be?) and check whether it has the -C option or not or
whether it has been overridden somewhere to see which configuration it
will end up using.

All of this wouldn't be a problem if we only allowed at most one server
per host.  Then we could standardize on fixed locations for everything.
But we do allow and many people do use more than one server instance per
host, and there it can be a great mess finding out where everything
belongs.  Putting everything under one directory by default is undoubtedly
the cleanest solution.  If you want to spread things around, use the tools
that the system gives you.

-- 
Peter Eisentraut   peter_e@gmx.net


Tue, 11 Dec 2001 12:22:30 +0100 (CET)
Peter Eisentraut <peter_e@gmx.net>
Re: Explicit configuration file

Peter Eisentraut wrote:
> 
> mlw writes:
> 
> > > That could be mildly useful, although symlinks make this already possible,
> > > and a bit clearer, IMHO.
> >
> > On systems which support symlinks, yes.
> 
> All systems that are able to run PostgreSQL support symlinks.
> 
> Really.

Windows does not supprt symlinks.

> 
> > Also, a system should be "self documenting" i.e. one should be able to put
> > clues to why certain things were done. Symlinks allow one to do something, yes,
> > but if I leave the company, someone besides me should be able to administrate
> > the system I leave behind.
> >
> > Don't you consider symlinks as a kind of a hack around a basic flaw in the
> > configuration process?
> 
> Elsewhere you stated that a certain aspect of the current situation is not
> very Unix-like.  Well, symlinks are very Unix-like.  They have been
> invented exactly for the purpose of sharing files for several purposes,
> while maintaining the identity of the "original" (else use hard links).
> They are not hacks, they can be nested and used recursively, they are
> self-documenting and they don't prevent you from adding your own
> documentation either.  I don't want to be adding a new feature anytime
> someone doesn't like the tools the operating system already provides.

This is a bogus argument, you must know that. Do you really beleive this? 

> 
> > Shouldn't the configuration file let you completely specify how your
> > system is configured?
> 
> Sure, it specifies how the PostgreSQL server behaves.  It is not concerned
> with telling your operating system how to behave.

What are you talking about? I am saying that the configuration file should be
able to specify how PostgreSQL works. This has nothing to do with configuring
the OS.

> 
> > Think about named, sendmail, apache, dhcpd, sshd, etc. All these programs have
> > the notion that he configuration is separate from the working data. To see how
> > they are configured, you just go to the "/etc" or "/etc/pgsql" directory and
> > read the configuration file(s).
> 
> named: Configuration and data files are both under /var/named.

Wrong, named uses named.conf (typically in the /etc directory) to point to
where its files are. And named has the "-c" option to specify which config fle
to use.

> 
> sendmail: is not a suitable example for a well-designed, easy-to-use
> software system.

Sendmail works great, it is dificult to configure, sure, but it does work quite
well. And yes, sendmail has a "-C" option to use a different configuration fle.


> 
> apache: Does not easily allow running multiple instances on one host.
> The virtual host setups I've seen put both configuration and data files
> under the same per-host directory.  Imagine what a mess it would be
> otherwise.

Again, wrong. Apache is VERY easy to make run multiple instances. As a server,
however, multiple instancs must run on different IP ports. One Apache process
can listen on multple ports, or you can use different configuration files to
specify how this works.

In apache, the option for the configuration file is "-f"

> 
> dhcpd, sshd: Only one instance per host supported/necessary.

Ahh, again, wrong. dhcpd can be started to work on all the ethernet interfaces,
or run one process for each, dhcpd uses the "-cf" option to specify which
configuration file to use. sshd uses the "-f" option to specify which
configuration to use, and more than one instance can be run on different ports.

> 
> Ironically, if sendmail hadn't the bear it is, my former employer would
> never have switched to a certain alternative MTA and I would never have
> gotten the inspiration for creating the postgresql.conf file the way it is
> today.

The postgresql.conf file is a great start. It should just be more inclusive of
configuration details. why not be able to specify the configuration file? Why
not be able to specify the hba config file? Why not be able to specify where
the data directory is?

These are things that UNIX admins EXPECT to be in a configuration file, why NOT
put them in?

> 
> > With postgres, you need to know where, and go to the data directory, as ROOT
> > (or the pg user) because you can't enter it otherwise, look at postgresql.conf,
> 
> Other users don't have a business reading that file.  That's a feature.

That's not completely true either. One can take off group all read rights if
they want it to be secret, however, securtity through obscurity is stupid and
foolish.

> 
> > do an "ls -l" to see which parts are symlinked and which are not. If you have
> > multiple PostgreSQL installations, you have to go to each directory and repeat
> > the process. (hyperbole, I know)
> 
> The alternative is that you have to scan the startup code for each server
> (where would that be?) and check whether it has the -C option or not or
> whether it has been overridden somewhere to see which configuration it
> will end up using.
> 
> All of this wouldn't be a problem if we only allowed at most one server
> per host.  Then we could standardize on fixed locations for everything.
> But we do allow and many people do use more than one server instance per
> host, and there it can be a great mess finding out where everything
> belongs.  Putting everything under one directory by default is undoubtedly
> the cleanest solution.  If you want to spread things around, use the tools
> that the system gives you.

I find your arguments irrational. Why NOT allow postgres to behave as other
UNIX server applications? If adding a feature neither hurts performance nor
changes the default behavior, but provides more flexability for the admin, why
NOT add it.

Arguing that "Symlinks" are clean is completely rediculous. There are so many
reasons why you DON'T want to use symlinks it is rediculous. Yes symlinks are a
tool in UNIX, one of its great features, but I think I speak for most UNIX
admins, if they can do something without a symlink, they would prefer to do so.

Arguing that PostgreSQL should be limited to one instance per host, putting
everything under one directory is he "cleanest" solution is absurd.

Again, virtually every other server on UNIX has the notion of a configuration
fle outside of its data, why is PostreSQL beter for not having this feature?
Why is being different than other UNIX servers beter? Why is NOT having
configuration options in the configuration file cleaner?

Tue, 11 Dec 2001 07:13:36 -0500
mlw <markw@mohawksoft.com>
Re: Explicit configuration file
...
> Isn't it easier to just use symlinks?

Maybe. Sometimes. In some cases. But even in those cases, easier is not
always better.

We've had "the symlink discussion" from time to time in the past. Some
folks are very comfortable with symlinks as part of the PostgreSQL
design model. But I'm *very* uncomfortable with symlinks in that role.

istm that Mark's suggestion for a command line option to specify a
configuration file (hmm, probably one or two more too) is well within
the scope of a reasonable feature for a good user interface. Configuring
a system should not require creating symlinks imho, especially not by
hand.

                       - Thomas

Tue, 11 Dec 2001 15:05:12 +0000
Thomas Lockhart <lockhart@fourpalms.org>
Re: Explicit configuration file
mlw wrote:

> > All systems that are able to run PostgreSQL support symlinks.
> >
> > Really.
> 
> Windows does not supprt symlinks.

Sure it does, windows does not call the symlinks, but it is used by
the desktop links and behave the same as you would expect.
They are sym-links, and CYGWIN does have symlinks.



> Arguing that "Symlinks" are clean is completely rediculous. There are
>  so many reasons why you DON'T want to use symlinks it is rediculous.
> Yes symlinks are a tool in UNIX, one of its great features, but I
> think I speak for most UNIX admins, if they can do something without a
> symlink, they would prefer to do so.

Why? I mean your argument to want a seperate config file is one issue.
But  I don't see your point here. (I'v done unix admin for over 20
years).
Chasing a symlink or finding a config file - both work.
Tue, 11 Dec 2001 13:04:20 -0700
Doug Royer <Doug@royer.com>
Re: Explicit configuration file
On Tuesday 11 December 2001 10:05 am, Thomas Lockhart wrote:
> > Isn't it easier to just use symlinks?

> Maybe. Sometimes. In some cases. But even in those cases, easier is not
> always better.

> We've had "the symlink discussion" from time to time in the past. Some
> folks are very comfortable with symlinks as part of the PostgreSQL
> design model. But I'm *very* uncomfortable with symlinks in that role.

I most assuredly agree with Thomas and Mark on this issue.  While some are 
very comfortable with symlinks in this role, I for one am not.  I would like 
postgresql.conf to not live in PGDATA.  I would like postgresql.conf to not 
get overwritten if I have to re-initdb.  I would, in fact, like to be able to 
put several postgresql.conf's, named differently, too, in /etc/pgsql for 
consistency with things such as BIND, xinetd, sendmail, and virtually any 
other reasonable daemon.

Suppose I host three databases on one box.  One database is for a client 
named varitor, one is for ramifordistat,  and one is for wgcr.  I would love 
to have a /etc/pgsql with the three files varitor.conf, ramifordistat.conf, 
and wgcr.conf.  Each config file would be able to specify the datadir (just 
like a webserver's config file specifies a pageroot, or BIND's named.conf 
specifies its datadir), as well as other unique config data such as IP 
address and/or port to bind to.  Then, postmaster could be started on these 
three config files with, perhaps, 'postmaster 
--config-file=/etc/pgsql/wgcr.conf' and postmaster loads, with the right 
configuration, without specifying a datadir.

To me, this is the natural way to do things.  Further, it is easily scripted, 
as well as easily packaged.   And the vast majority of other daemons do it 
this way.

And allowing this way is not the same thing as trying to prevent it from 
being the existing way -- they can coexist.

I just think, Peter, that you're being a mite rigid on this one.
-- 
Lamar Owen
WGCR Internet Radio
1 Peter 4:11

Tue, 11 Dec 2001 22:04:49 -0500
Lamar Owen <lamar.owen@wgcr.org>
Re: Explicit configuration file
> > Don't you consider symlinks as a kind of a hack around a basic flaw in the
> > configuration process?
> 
> Elsewhere you stated that a certain aspect of the current situation is not
> very Unix-like.  Well, symlinks are very Unix-like.  They have been
> invented exactly for the purpose of sharing files for several purposes,
> while maintaining the identity of the "original" (else use hard links).
> They are not hacks, they can be nested and used recursively, they are
> self-documenting and they don't prevent you from adding your own
> documentation either.  I don't want to be adding a new feature anytime
> someone doesn't like the tools the operating system already provides.

Let me throw in my ideas. Clearly, symlinks work, and clearly, a special
-C flag is more documenting than the symlinks.

My issue is, should we add yet another configuration flag to an already
flag-heavy command and let people use symlinks for special cases, or
should we add the flag.  I guess the question is whether the option will
be used by enough people that the extra flag is worth the added
complexity.

There is added complexity.  Every flag is evaluated by users to
determine if the flag is of any use to them, even if they don't use it.

I wonder if we should go one step further.  Should we be specifying the
config file on the command line _rather_ than the data directory. We
could then specify the data directory location in the config file.  That
seems like the direction we should be headed in, though I am not sure it
is worth the added headache of the switch.

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

Tue, 11 Dec 2001 22:56:27 -0500 (EST)
Bruce Momjian <pgman@candle.pha.pa.us>
Re: Explicit configuration file
Bruce Momjian <pgman@candle.pha.pa.us> writes:

> I wonder if we should go one step further.  Should we be specifying the
> config file on the command line _rather_ than the data directory. We
> could then specify the data directory location in the config file.  That
> seems like the direction we should be headed in, though I am not sure it
> is worth the added headache of the switch.

That's what mlw is advocating--all the startup script has to know is
the conf file location.  I for one think it's totally worth doing, and
it won't break any existing setups--if -C (or whatever) isn't
specified, postmaster expects PGDATA on the command line and gets the
donfig file from there; if it is, PGDATA comes from the config file.

-Doug
-- 
Let us cross over the river, and rest under the shade of the trees.
   --T. J. Jackson, 1863

12 Dec 2001 07:03:44 -0500
Doug McNaught <doug@wireboard.com>
Re: Explicit configuration file
Bruce Momjian wrote:

> I wonder if we should go one step further.  Should we be specifying the
> config file on the command line _rather_ than the data directory. We
> could then specify the data directory location in the config file.  That
> seems like the direction we should be headed in, though I am not sure it
> is worth the added headache of the switch.

That is what the patch I submitted does.

In the postgresql.conf file, you can specify where the data directory
is, as well as the pg_hba.conf file exists.

The purpose I had in mind was to allow sharing of pg_hba.conf files and
keep configuration separate from data.

One huge problem I have with symlinks is an admin has to "notice" that
two files in two separate directories, possibly on two different
volumes, are the same file, so it is very likely the ramifications of
editing one file are not obvious.

If, in the database configuration file, pghbaconfig points to
"/etc/pg_hba.conf" it is likely, that the global significance of the
file is obvious.

(Note: I don't nessisarily think "pghbaconfig" nor "pgdatadir" are the
best names for the parameters, but I couldn't think of anything else at
the time.)

Symlinks are a perilous UNIX construct, yes, they make some things, that
would otherwise be a horrible kludge, elegant, but they are also no
substitute for a properly configurable application.

Wed, 12 Dec 2001 11:13:37 -0500
mlw <markw@mohawksoft.com>
Re: Explicit configuration file
On Tue, Dec 11, 2001 at 10:56:27PM -0500, Bruce Momjian wrote:
> 
> My issue is, should we add yet another configuration flag to an already
> flag-heavy command and let people use symlinks for special cases, or
> should we add the flag.  I guess the question is whether the option will
> be used by enough people that the extra flag is worth the added
> complexity.

I can tell you that the Debian (and probably RedHat) packaged binaries
would use this switch: It already installs  pg_ident.conf, pg_hba.conf,
and postgresql.conf in /etc/postgresql, and puts symlinks into the
PGDATA dor pointing _back_ there, to keep the server happy. I'd forsee
the symlinks just going away.

> 
> There is added complexity.  Every flag is evaluated by users to
> determine if the flag is of any use to them, even if they don't use it.

Most users never look at _any_ of the flags. Most users who _compile there
own_ read the man page and evaluate the flags, I agree.
 
> I wonder if we should go one step further.  Should we be specifying the
> config file on the command line _rather_ than the data directory. We
> could then specify the data directory location in the config file.  That
> seems like the direction we should be headed in, though I am not sure it
> is worth the added headache of the switch.

Seems that's what's actually ben proposed, but in a backwards compatible
way.

Ross

Wed, 12 Dec 2001 14:40:49 -0600
"Ross J. Reedstrom" <reedstrm@rice.edu>
Re: Explicit configuration file
mlw writes:

> One huge problem I have with symlinks is an admin has to "notice" that
> two files in two separate directories, possibly on two different
> volumes, are the same file, so it is very likely the ramifications of
> editing one file are not obvious.
>
> If, in the database configuration file, pghbaconfig points to
> "/etc/pg_hba.conf" it is likely, that the global significance of the
> file is obvious.

How about making the "local" pg_hba.conf symlinked to /etc/pg_hba.conf?
Should be the same, no?

I guess I'm losing the symlink debate, but anyway...

Consider this:  What if I want to share my postgresql.conf file (because
of the clever performance tuning) but not my pg_hba.conf file (because I
have completely different databases and users in each server).  I think
that case should be covered as long as we're moving in this direction.

I think looming in the back is the answer, "add an 'include' directive to
postgresql.conf".

-- 
Peter Eisentraut   peter_e@gmx.net


Wed, 12 Dec 2001 23:25:41 +0100 (CET)
Peter Eisentraut <peter_e@gmx.net>
Re: Explicit configuration file
Peter Eisentraut wrote:
> 
> mlw writes:
> 
> > One huge problem I have with symlinks is an admin has to "notice" that
> > two files in two separate directories, possibly on two different
> > volumes, are the same file, so it is very likely the ramifications of
> > editing one file are not obvious.
> >
> > If, in the database configuration file, pghbaconfig points to
> > "/etc/pg_hba.conf" it is likely, that the global significance of the
> > file is obvious.
> 
> How about making the "local" pg_hba.conf symlinked to /etc/pg_hba.conf?
> Should be the same, no?
> 
> I guess I'm losing the symlink debate, but anyway...
> 
> Consider this:  What if I want to share my postgresql.conf file (because
> of the clever performance tuning) but not my pg_hba.conf file (because I
> have completely different databases and users in each server).  I think
> that case should be covered as long as we're moving in this direction.

In my patch, if no pghbaconfig setting is made, then the default is to
look in the data directory, as it has always done. If no pgdatadir is
specified, then it will get the information the old way too.

postmaster -C mysuperconfig.conf -D /u01/db

Should work fine.

> 
> I think looming in the back is the answer, "add an 'include' directive to
> postgresql.conf".

Yikes. Obviously that is next, however do we need this functionality?
Will a few changes be enough, or do we need includes? Do we need
includes within includes?

Wed, 12 Dec 2001 17:56:59 -0500
mlw <markw@mohawksoft.com>
Re: Explicit configuration file
Bruce Momjian wrote:
> 
> > Bruce Momjian wrote:
> >
> > > I wonder if we should go one step further.  Should we be specifying the
> > > config file on the command line _rather_ than the data directory. We
> > > could then specify the data directory location in the config file.  That
> > > seems like the direction we should be headed in, though I am not sure it
> > > is worth the added headache of the switch.
> >
> > That is what the patch I submitted does.
> >
> > In the postgresql.conf file, you can specify where the data directory
> > is, as well as the pg_hba.conf file exists.
> >
> > The purpose I had in mind was to allow sharing of pg_hba.conf files and
> > keep configuration separate from data.
> 
> My issue is that once we put the data directory location in
> postgresql.conf, we can't share that with other installs because they
> need different data locations, so what have we really gained _except_
> having the *.conf file in a different location.
> 
> Seems any solution will need to allow the *.conf file itself to be
> shared.
> 
> Here is an idea.  Allow multiple -C parameters to be used, with the
> files read in order, with newer parameters overriding older ones.  Seems
> this would be better than #includes.
> 
> Now that I think of it, #include does the same thing.  Instead of
> multiple -C, we have one file per instance and #include the global one,
> then set whatever we want.
> 
> One major thing this does that _symlinks_ do not do is allow most
> parameters to be set globally for postgresql.conf, and for individual
> instances to override _part_ of the global file.
> 
> Sorry I did not read the patch earlier.  I was more responding to the
> emails.

There is no reason that:

postmaster -C /path/postgresql.conf -D /u01/mydb 

Would not work. (Just don't specify a data diectory)

Wed, 12 Dec 2001 21:35:46 -0500
mlw <markw@mohawksoft.com>
Re: Explicit configuration file
> Bruce Momjian wrote:
> 
> > I wonder if we should go one step further.  Should we be specifying the
> > config file on the command line _rather_ than the data directory. We
> > could then specify the data directory location in the config file.  That
> > seems like the direction we should be headed in, though I am not sure it
> > is worth the added headache of the switch.
> 
> That is what the patch I submitted does.
> 
> In the postgresql.conf file, you can specify where the data directory
> is, as well as the pg_hba.conf file exists.
> 
> The purpose I had in mind was to allow sharing of pg_hba.conf files and
> keep configuration separate from data.

My issue is that once we put the data directory location in
postgresql.conf, we can't share that with other installs because they
need different data locations, so what have we really gained _except_
having the *.conf file in a different location.

Seems any solution will need to allow the *.conf file itself to be
shared.

Here is an idea.  Allow multiple -C parameters to be used, with the
files read in order, with newer parameters overriding older ones.  Seems
this would be better than #includes.

Now that I think of it, #include does the same thing.  Instead of
multiple -C, we have one file per instance and #include the global one,
then set whatever we want.

One major thing this does that _symlinks_ do not do is allow most
parameters to be set globally for postgresql.conf, and for individual
instances to override _part_ of the global file.

Sorry I did not read the patch earlier.  I was more responding to the
emails.

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

Wed, 12 Dec 2001 21:36:11 -0500 (EST)
Bruce Momjian <pgman@candle.pha.pa.us>
Re: Explicit configuration file