Re: PostgreSQL configuration

From: Thomas Swan <tswan(at)idigx(dot)com>
To: pgsql(at)mohawksoft(dot)com
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Stephan Szabo <sszabo(at)megazone(dot)bigpanda(dot)com>, Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, Mark Kirkwood <markir(at)paradise(dot)net(dot)nz>, rm_pg(at)cheapcomplexdevices(dot)com, Christopher Browne <cbbrowne(at)acm(dot)org>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: PostgreSQL configuration
Date: 2004-04-13 04:13:02
Message-ID: 407B68CD.9020905@idigx.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

pgsql(at)mohawksoft(dot)com wrote:

>>I just had a thought about this: seems like a big part of the objection
>>is the risk of specifying -C and -D that don't go together. Well, what
>>if they were the same switch? Consider the following simplification of
>>the proposed patch:
>>
>>
>
>I was really excited about this idea, then I thought about it, and while
>it would answer some of the issues I mean to address, I find myself a
>little disappointed that some of the functionality I wanted, i.e. multiple
>databases with the same configuration, was not possible. However,
>compromise is good.
>
>
>
>>1. Postmaster has just one switch, '-D datadir' with fallback to
>>environmental variable PGDATA, same as it ever was.
>>
>>
>
>I like this, I think, ... but it removes the posibility to run the same
>configuration with the same database. This scenario is one of my "best
>case" reasons why I think my patch is good, but, I think I can get 99% of
>what I'm looking for with my modification outlined at the bottom of this
>post.
>
>
>
>
>>2. The files that must be found in this directory are the configuration
>>files, namely postgresql.conf, pg_hba.conf, pg_ident.conf. (And any
>>files they include are taken as relative to this directory if not
>>specified with absolute path. We'll still add the #include facility
>>to postgresql.conf; the others have it already IIRC.)
>>
>>
>
>My patch *already* has this functionality if it is a directory. I agree
>with this, it was suggested (maybe even by you) over a year ago.
>
>
>[snip -- good stuff]
>
>Tom, this is great! I think we are almost there and I really appreciate
>your flexibility in view of my obstinance. :-)
>
>I like what you suggest, While I don't get the -D and -C functionality
>(which I don't use, but thought was cool), I think I would like to add one
>thing:
>
>postmaster -D /etc/postgres/postgresql.conf
>
>If the path specified is a config file, then "data_dir" MUST address a
>valid PostgreSQL data directory.
>
>

This is exceptionally confusing. Why not do a test and say that you
cannot specify a -C and a -D option at the same time. This would still
assure backwards compatability and safeguard future installations. If
the -C option is specified the datadir must be present in the config
file.

If someone wants to specify the config file from a startup option, then
they must follow the new rules. And, as this is new functionality, the
rules can be set now.

Adding one command line switch with the future possibility of
eliminating the others is a good tradeoff, IMHO.

>So, here is (how I see) the logical breakdown of the feature:
>
>"postmaster -D /somedir/data" works as it always has, it points to the
>data dirtectory in which all the various config files live. If No
>"data_dir" is specified, then "/somedir/data" is assumed to be where base,
>pg_xlog, pg_clog, and etc. reside.
>
>If, however, "data_dir" is specified, the data oriented elements like
>"global," "base," "pg_clog," and "pg_xlog" are contained within that
>directory. (In the future, we may be able to specify these locations
>separately)
>
>If "postmaster -D /etc/postgresql.conf" points to a file, then that file
>MUST specify the location of "data_dir," "hba_conf," and "ident_conf."
>
>Like I said, while I don't get the convenience of combining "-D ..." and
>"-C ..." I do get most of what I'm asking for.
>
>If this works for all you guys, I'll submit a patch Wednesday.
>
>---------------------------(end of broadcast)---------------------------
>TIP 8: explain analyze is your friend
>
>

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Kevin Brown 2004-04-13 05:14:38 Re: PostgreSQL configuration
Previous Message Thomas Swan 2004-04-13 04:02:53 Re: PostgreSQL configuration