user defined settings (aka user defined guc variables)

Поиск
Список
Период
Сортировка
От Joe Conway
Тема user defined settings (aka user defined guc variables)
Дата
Msg-id 3E011A23.5030604@joeconway.com
обсуждение исходный текст
Ответы Re: user defined settings (aka user defined guc variables)  (Gavin Sherry <swm@linuxworld.com.au>)
Re: user defined settings (aka user defined guc variables)  (Bruce Momjian <pgman@candle.pha.pa.us>)
Re: user defined settings (aka user defined guc variables)  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: user defined settings (aka user defined guc variables)  (Peter Eisentraut <peter_e@gmx.net>)
Список pgsql-hackers
I've been playing around with making it possible to create user defined guc 
variables. This has been discussed, at least in passing, before. And it is 
even anticipated in guc.c as a possible future feature:
/* * Build the sorted array.    This is split out so that it could be * re-executed after startup (eg, we could allow
loadablemodules to * add vars, and then we'd need to re-sort). */
 

It is a feature that would be nice to have, so that, for example, a user 
defined variable named "my_classpath" could be created to point to the java 
CLASSPATH needed by a custom C function.

So far I have this much working:
- A new backend function, pg_create_user_setting(name, value, islocal) is used  to "register" the setting.
- SHOW ALL, SHOW, current_setting(), and pg_show_all_settings()) will display  it just like any other setting
- Similarly, SET and set_config() will change it.

I still need to make the user defined settings survive being saved by ALTER 
USER or ALTER DATABASE. I'm also thinking about a corresponding grammar 
addition, something along the lines of:
  CREATE SETTING name WITH VALUE value;

This would effectively perform:  SELECT pg_create_user_setting(name, value, false);

I'm wondering whether it would be "a good thing" or "a bad thing" to have 
unrecognized settings found in postgresql.conf be registered as user defined 
settings?

Any comments, concerns, or objections?

Thanks,

Joe



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: 7.3.1 documentation updates
Следующее
От: Gavin Sherry
Дата:
Сообщение: Re: user defined settings (aka user defined guc variables)