Re: custom guc vars

From: Brent Verner <brent(at)rcfile(dot)org>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: custom guc vars
Date: 2005-05-02 08:15:36
Message-ID: 20050502081536.GA22439@rcfile.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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 = 'some string'
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);
}

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Oliver Jowett 2005-05-02 08:49:07 Re: Feature freeze date for 8.1
Previous Message Peter Eisentraut 2005-05-02 08:11:40 Re: Feature freeze date for 8.1