Re: SQL command to edit postgresql.conf, with comments

Поиск
Список
Период
Сортировка
От Josh Berkus
Тема Re: SQL command to edit postgresql.conf, with comments
Дата
Msg-id 4CB4DAF9.3090504@agliodbs.com
обсуждение исходный текст
Ответ на Re: SQL command to edit postgresql.conf, with comments  (Darren Duncan <darren@darrenduncan.net>)
Ответы Re: SQL command to edit postgresql.conf, with comments
Список pgsql-hackers
Darren, All,

> All you would need is for the file parser to retain the
> comments as metadata, include them in the relations that the SQL
> commands see where the latter can also edit them as data, and then write
> out the updated file with comments.

"All you need to do" in order to trisect and angle is to divide it into
three equal parts using just a compass and straightedge.

Given the number of different ways people can comment up pg.conf files,
and the fact that they can have the same settings set multiple times in
the file, both commented and uncommented, and that both the settings and
the comments can be in any order, with user-created spacing, you've
added a *huge* burden of parsing code to any .conf updater.  One which
would, in terms of LOC, exceed the updating code by more than 300%.

>  The fact that Postgres already
> explicitly supports comment metadata in its system catalog means it must
> already know something about this.

We support what?

The solution to this is simple, and was previously discussed on this list:

(a) have a postgresql.conf.auto
(b) add a default include for postgresql.conf.auto at the beginning of
PostgreSQL.conf
(c) SQL updates go to postgresql.conf.auto, which consists only of
"setting = value" in alphabetical order.
(d) We document that settings which are changed manually in
postgresql.conf will override postgresql.conf.auto.
(e) $$profit$$!!

--Josh Berkus

--                                  -- Josh Berkus                                    PostgreSQL Experts Inc.
                        http://www.pgexperts.com
 


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

Предыдущее
От: "Kevin Grittner"
Дата:
Сообщение: Re: SQL command to edit postgresql.conf, with comments
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: [GENERAL] Text search parser's treatment of URLs and emails