Re: GUC assign hooks (was Re: wal_buffers = -1 and SIGHUP)

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: GUC assign hooks (was Re: wal_buffers = -1 and SIGHUP)
Дата
Msg-id 3836.1301944479@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: GUC assign hooks (was Re: wal_buffers = -1 and SIGHUP)  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: GUC assign hooks (was Re: wal_buffers = -1 and SIGHUP)  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
> On Mon, Apr 4, 2011 at 2:58 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> Another variant would be to allow the check_hook to pass back a separate
>> "void *" value that could be passed on to the assign_hook, containing
>> any necessary derived data. �This is logically a bit cleaner, and would
>> work for all types of GUC variables; but it would make things messier in
>> guc.c since there would be an additional value to pass around. �I'm not
>> convinced it's worth that, but could be talked into it if anyone feels
>> strongly about it.

> I haven't really got the mental energy to think through all of this
> right now in detail, but I think that might be better.  I think
> there's more kludgery here than we're going to fix in one pass, so as
> long as we're making improvements, I'm happy.  Is there any case for
> using a Datum rather than a void * so people can pack a short quantity
> in directly without allocating memory, or are we expecting this to
> always be (say) a struct pointer?

Well, I was intending to insist that the void* parameter point to a
single malloc'd block, so that guc.c could release it when the value was
no longer of interest by doing free().  If we don't say that, then we
are going to need a "free" hook for those objects, which is surely way
more notational overhead than is likely to be repaid for the occasional
cases where a single OID or whatever would be sufficient info.
        regards, tom lane


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

Предыдущее
От: Dave Page
Дата:
Сообщение: Re: [DOCS] Uppercase SGML entity declarations
Следующее
От: Susanne Ebrecht
Дата:
Сообщение: Re: [DOCS] Uppercase SGML entity declarations