Re: Hiding undocumented enum values?

From: Magnus Hagander <magnus(at)hagander(dot)net>
To: "Alex Hunsaker" <badalex(at)gmail(dot)com>
Cc: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Hiding undocumented enum values?
Date: 2008-05-28 09:04:11
Message-ID: 20080528110411.248b78ed@mha-laptop.hagander.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Alex Hunsaker wrote:
> On Tue, May 27, 2008 at 12:05 PM, Magnus Hagander
> <magnus(at)hagander(dot)net> wrote:
> > Alex Hunsaker wrote:
> >> On Tue, May 27, 2008 at 10:20 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
> >> wrote:
> >> > I am wondering if it's a good idea to hide the redundant entries
> >> > to reduce clutter in the pg_settings display. (We could do this
> >> > by adding a "hidden" boolean to struct config_enum_entry.)
> >> > Thoughts?
> >>
> >> +1
> >>
> >> > regards, tom lane
> >>
> >> Maybe something like the attached patch?
> >
> > Oops, missed that there was a patch posted already. Looks like the
> > way to do it (except I'd move the comment :-P) if that's the way we
> > go.
>
> OK, the updated patch is on pg_patches under "guc config_enum_entry
> add hidden field"

Thanks, I've reviewed and applied.

> -moved the comment into config_enum_get_options()

I moved it again, to the header :-)

> -fixed a possible buffer underrun if every option was hidden

That fix didn't take into account the possibility of having different
prefixes. Since it is a pretty stupid thing to have a GUC enum with
*only* hidden entries, I just made it do nothing in this case and
updated the comment. The buffer underrun check is still there.

> >> I looked into just making it a string so we could use parse_bool...
> >> because backslash_quote seems to be the exception not the rule.
> >> But I decided having a hidden flag seems more useful anyway...
> >
> > It used to be a string. We don't want that, because then we can't
> > tell the client which possible values are available. That's the
> > whole reason for the creation of the enum type gucs...
>
> Well its good i did not go that route then :)

Yup :)

//Magnus

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Magnus Hagander 2008-05-28 09:10:10 Re: Remove redundant extra_desc info for enum GUC variables?
Previous Message Simon Riggs 2008-05-28 08:25:54 Re: Hint Bits and Write I/O