mirror of https://github.com/citusdata/citus.git
Turn on GUC_REPORT flag for search_path to enable reporting back the parameter value upon change. (#6983)
DESCRIPTION: Turns on the GUC_REPORT flag for search_path. This results in postgres to report the parameter status back in addition to Command Complete packet. In response to the following command, > SET search_path TO client1; postgres sends back the following packets (shown in pseudo form): C (Command Complete) SET + **S (Parameter Status) search_path = client1**pull/7006/head
parent
3cc7a4aa42
commit
4f793abc4a
|
@ -191,7 +191,7 @@ static void CitusCleanupConnectionsAtExit(int code, Datum arg);
|
||||||
static void DecrementExternalClientBackendCounterAtExit(int code, Datum arg);
|
static void DecrementExternalClientBackendCounterAtExit(int code, Datum arg);
|
||||||
static void CreateRequiredDirectories(void);
|
static void CreateRequiredDirectories(void);
|
||||||
static void RegisterCitusConfigVariables(void);
|
static void RegisterCitusConfigVariables(void);
|
||||||
static void OverridePostgresConfigAssignHooks(void);
|
static void OverridePostgresConfigProperties(void);
|
||||||
static bool ErrorIfNotASuitableDeadlockFactor(double *newval, void **extra,
|
static bool ErrorIfNotASuitableDeadlockFactor(double *newval, void **extra,
|
||||||
GucSource source);
|
GucSource source);
|
||||||
static bool WarnIfDeprecatedExecutorUsed(int *newval, void **extra, GucSource source);
|
static bool WarnIfDeprecatedExecutorUsed(int *newval, void **extra, GucSource source);
|
||||||
|
@ -2587,16 +2587,17 @@ RegisterCitusConfigVariables(void)
|
||||||
/* warn about config items in the citus namespace that are not registered above */
|
/* warn about config items in the citus namespace that are not registered above */
|
||||||
EmitWarningsOnPlaceholders("citus");
|
EmitWarningsOnPlaceholders("citus");
|
||||||
|
|
||||||
OverridePostgresConfigAssignHooks();
|
OverridePostgresConfigProperties();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* OverridePostgresConfigAssignHooks overrides GUC assign hooks where we want
|
* OverridePostgresConfigProperties overrides GUC properties where we want
|
||||||
* custom behaviour.
|
* custom behaviour. We should consider using Postgres function find_option
|
||||||
|
* in this function once it is exported by Postgres in a later release.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
OverridePostgresConfigAssignHooks(void)
|
OverridePostgresConfigProperties(void)
|
||||||
{
|
{
|
||||||
struct config_generic **guc_vars = get_guc_variables();
|
struct config_generic **guc_vars = get_guc_variables();
|
||||||
int gucCount = GetNumConfigOptions();
|
int gucCount = GetNumConfigOptions();
|
||||||
|
@ -2612,6 +2613,17 @@ OverridePostgresConfigAssignHooks(void)
|
||||||
OldApplicationNameAssignHook = stringVar->assign_hook;
|
OldApplicationNameAssignHook = stringVar->assign_hook;
|
||||||
stringVar->assign_hook = ApplicationNameAssignHook;
|
stringVar->assign_hook = ApplicationNameAssignHook;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Turn on GUC_REPORT for search_path. GUC_REPORT provides that an S (Parameter Status)
|
||||||
|
* packet is appended after the C (Command Complete) packet sent from the server
|
||||||
|
* for SET command. S packet contains the new value of the parameter
|
||||||
|
* if its value has been changed.
|
||||||
|
*/
|
||||||
|
if (strcmp(var->name, "search_path") == 0)
|
||||||
|
{
|
||||||
|
var->flags |= GUC_REPORT;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue