Re: [gsmith@gregsmith.com: Re: [patch] GUC source file and line number] - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: [gsmith@gregsmith.com: Re: [patch] GUC source file and line number]
Date
Msg-id 20080909024653.GO4411@alvh.no-ip.org
Whole thread Raw
In response to Re: [gsmith@gregsmith.com: Re: [patch] GUC source file and line number]  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: [gsmith@gregsmith.com: Re: [patch] GUC source file and line number]  (Greg Smith <gsmith@gregsmith.com>)
Re: [gsmith@gregsmith.com: Re: [patch] GUC source file and line number]  (Magnus Hagander <magnus@hagander.net>)
List pgsql-hackers
Tom Lane wrote:
> Alvaro Herrera <alvherre@commandprompt.com> writes:
> > Tom Lane wrote:

> > Hmm, I didn't recheck after Greg's patch, but in mine, it doesn't,
> > because the location is saved as "reset location" and restored when the
> > variable is reset.  It worked fine in all cases I tested.
>
> Hmm.  Actually, why is there a need to save and restore at all?  There
> can certainly never be more than one recorded config-file location per
> variable.  What about saying that each variable has one and only one
> filename/linenumber, but whether these are relevant to the current value
> is determined by whether the current value's source is S_FILE?

Hmm, this does make the patch a lot simpler.  Attached.  (Magnus was
visionary enough to put the correct test in the pg_settings definition.)

I also dropped the change to set_config_option, and added a new routine
to set the source file/line, as you suggested elsewhere.  The only
problem is that we now have two bsearch calls for each option set in a
config file ...  I don't want to change set_config_option just to be
able to return the struct config_generic for this routine's sake ...
Better ideas?  Is this OK as is?

I noticed some weird things when the config files contain errors, but I
think it's outside this patch's scope.

(I dropped the "default" stuff for now, as it doesn't seem that a
consensus has been reached on that topic.)

--
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

Attachment

pgsql-hackers by date:

Previous
From: Stephen Frost
Date:
Subject: [Patch Review] Copy column storage parameters on CREATE TABLE LIKE/INHERITS
Next
From: Ron Mayer
Date:
Subject: Re: [PATCH] Cleanup of GUC units code