Re: WIP: guc enums - Mailing list pgsql-patches

From Tom Lane
Subject Re: WIP: guc enums
Date
Msg-id 21962.1204724456@sss.pgh.pa.us
Whole thread Raw
In response to Re: WIP: guc enums  ("Heikki Linnakangas" <heikki@enterprisedb.com>)
Responses Re: WIP: guc enums  (Andrew Dunstan <andrew@dunslane.net>)
List 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 by date:

Previous
From: "Heikki Linnakangas"
Date:
Subject: Re: WIP: guc enums
Next
From: Tom Lane
Date:
Subject: Re: Sun Studio on Linux spinlock patch