mirror of https://github.com/citusdata/citus.git
Forward to existing emit_log_hook in our log hook (#6877)
DESCRIPTION: Forward to existing emit_log_hook in our log hook This makes us work better with other extensions installed in Postgres. Without this change we would overwrite their emit_log_hook, causing it to never be called. Fixes #6874pull/6909/head^2
parent
e3c6b8a10e
commit
07b8cd2634
|
@ -213,6 +213,7 @@ static bool IsSuperuser(char *userName);
|
||||||
static void AdjustDynamicLibraryPathForCdcDecoders(void);
|
static void AdjustDynamicLibraryPathForCdcDecoders(void);
|
||||||
|
|
||||||
static ClientAuthentication_hook_type original_client_auth_hook = NULL;
|
static ClientAuthentication_hook_type original_client_auth_hook = NULL;
|
||||||
|
static emit_log_hook_type original_emit_log_hook = NULL;
|
||||||
|
|
||||||
/* *INDENT-OFF* */
|
/* *INDENT-OFF* */
|
||||||
/* GUC enum definitions */
|
/* GUC enum definitions */
|
||||||
|
@ -458,6 +459,7 @@ _PG_init(void)
|
||||||
ExecutorEnd_hook = CitusAttributeToEnd;
|
ExecutorEnd_hook = CitusAttributeToEnd;
|
||||||
|
|
||||||
/* register hook for error messages */
|
/* register hook for error messages */
|
||||||
|
original_emit_log_hook = emit_log_hook;
|
||||||
emit_log_hook = multi_log_hook;
|
emit_log_hook = multi_log_hook;
|
||||||
|
|
||||||
|
|
||||||
|
@ -698,6 +700,11 @@ multi_log_hook(ErrorData *edata)
|
||||||
edata->message = pstrdup("canceling the transaction since it was "
|
edata->message = pstrdup("canceling the transaction since it was "
|
||||||
"involved in a distributed deadlock");
|
"involved in a distributed deadlock");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (original_emit_log_hook)
|
||||||
|
{
|
||||||
|
original_emit_log_hook(edata);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue