Re: WIP: guc enums

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Heikki Linnakangas" <heikki(at)enterprisedb(dot)com>
Cc: "Magnus Hagander" <magnus(at)hagander(dot)net>, "pgsql-patches" <pgsql-patches(at)postgresql(dot)org>
Subject: Re: WIP: guc enums
Date: 2008-03-05 13:40:56
Message-ID: 21962.1204724456@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

"Heikki Linnakangas" <heikki(at)enterprisedb(dot)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

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2008-03-05 13:56:28 Re: Sun Studio on Linux spinlock patch
Previous Message Heikki Linnakangas 2008-03-05 13:33:09 Re: WIP: guc enums