Re: WIP: guc enums

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: WIP: guc enums
Дата
Msg-id 21962.1204724456@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: WIP: guc enums  ("Heikki Linnakangas" <heikki@enterprisedb.com>)
Ответы Re: WIP: guc enums  (Andrew Dunstan <andrew@dunslane.net>)
Список pgsql-patches
"Heikki Linnakangas" <heikki@enterprisedb.com> writes:
> Oh no, I didn't suggest keeping the variables as strings, that's
> madness. I suggested keeping the variables as enums, and defining
> "setter" functions for them, similar to the assign hooks we have now,
> but the setter function wouldn't have to do anything else than assign an
> int to the enum variable. The setter function would be just a
> replacement for "*((int *)variable) = X".

Oh, I misunderstood.  That would work, though you'd *also* need a fetch
function.  Having to have two extra hook functions for every variable
seems like a lot of notational overhead for not much gain.  (In my
experience C compilers are pretty darn lax about enums anyway, and so
there's not that much "strong typing" benefit to be gained from
declaring the variables as enums rather than int.)

            regards, tom lane

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

Предыдущее
От: "Heikki Linnakangas"
Дата:
Сообщение: Re: WIP: guc enums
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Sun Studio on Linux spinlock patch