Re: PostgreSQL configuration

Поиск
Список
Период
Сортировка
От Thomas Swan
Тема Re: PostgreSQL configuration
Дата
Msg-id 407B68CD.9020905@idigx.com
обсуждение исходный текст
Ответ на Re: PostgreSQL configuration  (pgsql@mohawksoft.com)
Список pgsql-hackers
pgsql@mohawksoft.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
>  
>



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Thomas Swan
Дата:
Сообщение: Re: PostgreSQL configuration
Следующее
От: Kevin Brown
Дата:
Сообщение: Re: PostgreSQL configuration