Skip site navigation (1) Skip section navigation (2)

Re: custom variable classes

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: custom variable classes
Date: 2006-11-28 21:19:04
Message-ID: 456CA7C8.20900@dunslane.net (view raw or flat)
Thread:
Lists: pgsql-hackers
Tom Lane wrote:
> Andrew Dunstan <andrew(at)dunslane(dot)net> writes:
>   
>> One thing I want to look at for 8.3 is improving custom variable 
>> classes. Right now these are all user settable, which makes them quite 
>> inappropriate for security related settings (such as which perl modules 
>> to load for use by trusted plperl). I'm wondering if we should perhaps 
>> allow something like:
>>     
>
>   
>>   custom_variable_classes = 'foo'
>>   foo:<security_level>.bar = 'blurfl'
>>     
>
> This seems really ugly --- for one thing, what if the DBA gets it wrong?
>
>   

We have no defence against them setting the wrong value anyway. What I 
want is a defence against it being set in the wrong context.

> The value won't mean anything until the code that uses it gets loaded,
> at which time the correct GucContext for the variable will be supplied.
> How about we just compare that to the current definition source of the
> value, and if we see it's been set improperly, revert the value to
> default?
>   

Sounds interesting - can you expand on this a bit?

> It might also be a good idea to disallow ALTER USER/DATABASE SET for a
> custom variable that's a placeholder, since we don't at that time know
> if the value should be SUSET or not; and there seems no pressing need to
> allow these ALTERs to be done without having loaded the defining module.
>
> [ thinks for a bit... ]  With that provision in place, I think it would
> be safe to revert to the "reset" value instead of the wired-in default,
> which would be marginally nicer.
>
> 			
>   

Where is the wired-in default for a custom GUC var? This whole thing 
needs some documentation, ISTM.

cheers

andrew


In response to

Responses

pgsql-hackers by date

Next:From: Tom LaneDate: 2006-11-28 21:32:38
Subject: Re: custom variable classes
Previous:From: Peter EisentrautDate: 2006-11-28 20:13:50
Subject: Re: Potential to_char localization bug

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group