On Wed, Mar 05, 2008 at 08:18:19AM -0500, Tom Lane wrote:
> "Heikki Linnakangas" <[EMAIL PROTECTED]> writes:
> > Tom Lane wrote:
> >> What I'd suggest is declaring the actual variable as int. You can still
> >> use an enum typedef to declare the values, and just avert your eyes
> >> when you have
Tom Lane wrote:
Having to have two extra hook functions for every variable
seems like a lot of notational overhead for not much gain.
+1
cheers
andrew
--
Sent via pgsql-patches mailing list (pgsql-patches@postgresql.org)
To make changes to your subscription:
http://mail.postgresql.org
"Heikki Linnakangas" <[EMAIL PROTECTED]> 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
Tom Lane wrote:
"Heikki Linnakangas" <[EMAIL PROTECTED]> writes:
Tom Lane wrote:
What I'd suggest is declaring the actual variable as int. You can still
use an enum typedef to declare the values, and just avert your eyes
when you have to cast the enum to int or vice versa. (This is legal per
"Heikki Linnakangas" <[EMAIL PROTECTED]> writes:
> Tom Lane wrote:
>> What I'd suggest is declaring the actual variable as int. You can still
>> use an enum typedef to declare the values, and just avert your eyes
>> when you have to cast the enum to int or vice versa. (This is legal per
>> C spec
On Tue, Mar 04, 2008 at 09:35:27PM +, Heikki Linnakangas wrote:
>
> We could keep using the assignment hooks. But they could be a lot
> simpler than they are nowadays, if the string -> int conversion was done
> by the GUC machinery:
>
> static const char *
> assign_client_min_messages(int n
Tom Lane wrote:
"Heikki Linnakangas" <[EMAIL PROTECTED]> writes:
Magnus Hagander wrote:
On my platform (linux x86) it works fine when I just cast this to (int *),
but I'm unsure if that's going to be safe on other platforms. I had some
indication that it's probably not?
No, I don't think that
"Heikki Linnakangas" <[EMAIL PROTECTED]> writes:
> Magnus Hagander wrote:
>> On my platform (linux x86) it works fine when I just cast this to (int *),
>> but I'm unsure if that's going to be safe on other platforms. I had some
>> indication that it's probably not?
> No, I don't think that's safe.
Magnus Hagander wrote:
The patch only converts a couple of the potential enum variables to the new
type, mainly as a proof of concept. But already I hit the problem twice -
the variable that holds the value of the guc enum is a C enum itself, which
gives a compiler warning when I pass a pointer t