Cppgres
Build Postgres extensions in C++
Loading...
Searching...
No Matches
guc.hpp File Reference
#include "guard.hpp"
#include "imports.h"
#include <utils/guc.h>

Go to the source code of this file.

Classes

struct  cppgres::guc_bool_options
 Optional settings for a boolean GUC definition. More...
 
struct  cppgres::guc_string_options
 Optional settings for a string GUC definition. More...
 
struct  cppgres::guc_enum_options
 Optional settings for an enum GUC definition. More...
 

Functions

void cppgres::define_guc (const char *name, const char *short_desc, bool *var, bool default_value, const guc_bool_options &opts={})
 Define a custom boolean GUC (DefineCustomBoolVariable)
 
void cppgres::define_guc (const char *name, const char *short_desc, char **var, const char *default_value, const guc_string_options &opts={})
 Define a custom string GUC (DefineCustomStringVariable)
 
void cppgres::define_guc (const char *name, const char *short_desc, int *var, int default_value, const ::config_enum_entry *entries, const guc_enum_options &opts={})
 Define a custom enum GUC (DefineCustomEnumVariable)
 
void cppgres::reserve_guc_prefix (const char *prefix)
 Reserve a GUC prefix for this extension (MarkGUCPrefixReserved)
 

Function Documentation

◆ define_guc() [1/3]

void cppgres::define_guc ( const char *  name,
const char *  short_desc,
bool *  var,
bool  default_value,
const guc_bool_options opts = {} 
)
inline

Define a custom boolean GUC (DefineCustomBoolVariable)

Runs under cppgres::ffi_guard, so a Postgres error surfaces as cppgres::pg_exception.

◆ define_guc() [2/3]

void cppgres::define_guc ( const char *  name,
const char *  short_desc,
char **  var,
const char *  default_value,
const guc_string_options opts = {} 
)
inline

Define a custom string GUC (DefineCustomStringVariable)

Runs under cppgres::ffi_guard, so a Postgres error surfaces as cppgres::pg_exception.

◆ define_guc() [3/3]

void cppgres::define_guc ( const char *  name,
const char *  short_desc,
int *  var,
int  default_value,
const ::config_enum_entry *  entries,
const guc_enum_options opts = {} 
)
inline

Define a custom enum GUC (DefineCustomEnumVariable)

Runs under cppgres::ffi_guard, so a Postgres error surfaces as cppgres::pg_exception.

◆ reserve_guc_prefix()

void cppgres::reserve_guc_prefix ( const char *  prefix)
inline

Reserve a GUC prefix for this extension (MarkGUCPrefixReserved)

Reserve the prefix only after every GUC under it has been defined: reserving earlier discards the placeholders for GUCs defined later, so values SET before the module was loaded would be thrown away.

Runs under cppgres::ffi_guard, so a Postgres error surfaces as cppgres::pg_exception.