Re: custom guc vars - Mailing list pgsql-hackers

From Brent Verner
Subject Re: custom guc vars
Date
Msg-id 20050502081536.GA22439@rcfile.org
Whole thread Raw
In response to custom guc vars  (Andrew Dunstan <andrew@dunslane.net>)
List pgsql-hackers
[2005-05-01 18:38] Andrew Dunstan said:
| 
| Is there a readme somewhere on how modules are supposed to use custom 
| GUC variables? If there is I have missed it.
 I don't think there is any documentation for this, but here's a
simple overview.

cheers.Brent

=== postgresql.conf ===
 custom_variable_classes = 'mymodule, anothermodule' mymodule.integer = 10 mymodule.double = 5.5 mymodule.string =
'somestring' mymodule.bool = true anothermodule.whatever = 'some string' anothermodule.other = false
 


=== moduleConfig.c ===
 #include <utils/guc.h>
 int anIntVar; char* aStringVar; double aDoubleVar; bool aBoolVar;
 void setCustomVars() {   DefineCustomIntegerVariable(       "mymodule.integer",       "A custom integer guc var",
NULL,       &anIntVar,       PGC_USERSET,       NULL,NULL);
 
   DefineCustomStringVariable(       "mymodule.string",       "A custom string guc var",       NULL,       &aStringVar,
     PGC_USERSET,       NULL,NULL);
 
   DefineCustomRealVariable(       "mymodule.double",       "A custom double guc var",       NULL,       &aDoubleVar,
   PGC_USERSET,       NULL,NULL);
 
   DefineCustomBoolVariable(       "mymodule.bool",       "A custom bool guc var",       NULL,       &aBoolVar,
PGC_USERSET,      NULL,NULL); }
 



pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: Feature freeze date for 8.1
Next
From: Oliver Jowett
Date:
Subject: Re: Feature freeze date for 8.1