Re: [PATCH] Cleanup of GUC units code

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [PATCH] Cleanup of GUC units code
Дата
Msg-id 16745.1221134278@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: [PATCH] Cleanup of GUC units code  (Peter Eisentraut <peter_e@gmx.net>)
Список pgsql-hackers
Peter Eisentraut <peter_e@gmx.net> writes:
> temp_buffers is actually special-cased in the code because

>     /*
>      * We show the GUC var until local buffers have been initialized, and
>      * NLocBuffer afterwards.
>      */

> It is not clear to me right now why that is a good idea.

I think the reason for it is that you can change the setting within a
particular session, but only up until temp buffers have been initialized
(ie, when you first touch a temp table).  If we just made it act like
other GUCs then SHOW would be lying to you about the effective value
if you changed it after that point.

An easy workaround would be to make the variable PGC_BACKEND, but that
seems to me to lose useful flexibility.  Or we could invent a context
category specifically for this type of behavior, but is it worth that?

The narrowest fix would be to just teach the show hook to format its
result properly.  I seem to recall having looked at that and been
annoyed by the amount of copy-and-paste required.

[ thinks for a bit... ]  Or maybe we should get rid of the show hook
and instead put in an assign hook that prevents changes after the
initialization event.  The problem is that you can't throw error
while reading, eg, a new config file.  So while this might be the most
user-friendly approach, I think it would take some API change for assign
hooks.
        regards, tom lane


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

Предыдущее
От: Heikki Linnakangas
Дата:
Сообщение: Re: New FSM patch
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: Move src/tools/backend/ to wiki