Re: [RFC] Extend namespace of valid guc names

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Andres Freund <andres(at)2ndquadrant(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [RFC] Extend namespace of valid guc names
Date: 2013-09-07 03:19:37
Message-ID: 14857.1378523977@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Robert Haas <robertmhaas(at)gmail(dot)com> writes:
> On Fri, Sep 6, 2013 at 6:31 PM, Andres Freund <andres(at)2ndquadrant(dot)com> wrote:
>> On 2013-09-06 14:48:33 -0400, Tom Lane wrote:
>>> Well, sure, but I would think that ALTER SYSTEM SET should be constrained
>>> to only set known GUCs, not invent new ones on the fly.

>> Hm. That sounds inconvenient to me. Consider something like configuring
>> the system to use auto_explain henceforth.
>> ALTER SYSTEM SET shared_preload_libraries = 'auto_explain';
>> ALTER SYSTEM SET auto_explain.log_min_duration = 100;

> I'm with Tom on this one: I think this will save more pain than it causes.

So far as that example goes, I'm not suggesting that "ALTER SYSTEM SET
auto_explain.log_min_duration" should be forbidden altogether. I *am*
saying that it should only be allowed when auto_explain is loaded in the
current session, so that we can find out whether the proposed value is
allowed by the module that defines the GUC.

Of course, this is not completely bulletproof, since it will fail if the
defining module changes its mind from time to time about what are valid
values of the GUC :-(. But promising to restart in the face of that kind
of inconsistency is hopeless. On the other hand, not checking at all is
just asking for failures.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Kohei KaiGai 2013-09-07 03:31:22 Re: Custom Plan node
Previous Message Bruce Momjian 2013-09-07 03:07:04 Re: strange IS NULL behaviour