projects
/
plantuner.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
0ed6fd7
)
also check IsTransactionState, it helps support of pg_reload_config
author
Teodor Sigaev
<teodor@sigaev.ru>
Thu, 14 Feb 2019 20:18:39 +0000
(23:18 +0300)
committer
Teodor Sigaev
<teodor@sigaev.ru>
Thu, 14 Feb 2019 20:18:39 +0000
(23:18 +0300)
plantuner.c
patch
|
blob
|
history
diff --git
a/plantuner.c
b/plantuner.c
index
050e3b7
..
3c5c6c7
100644
(file)
--- a/
plantuner.c
+++ b/
plantuner.c
@@
-32,6
+32,7
@@
#include <fmgr.h>
#include <miscadmin.h>
#include <access/heapam.h>
#include <fmgr.h>
#include <miscadmin.h>
#include <access/heapam.h>
+#include <access/xact.h>
#include <catalog/namespace.h>
#include <catalog/pg_class.h>
#include <nodes/pg_list.h>
#include <catalog/namespace.h>
#include <catalog/pg_class.h>
#include <nodes/pg_list.h>
@@
-77,6
+78,23
@@
indexesAssign(const char * newval, bool doit, GucSource source, bool isDisable)
if (!SplitIdentifierString(rawname, ',', &namelist))
goto cleanup;
if (!SplitIdentifierString(rawname, ',', &namelist))
goto cleanup;
+ /*
+ * follow work could be done only in normal processing because of
+ * accsess to system catalog
+ */
+ if (MyBackendId == InvalidBackendId || !IsUnderPostmaster ||
+ !IsNormalProcessingMode() || MyAuxProcType != NotAnAuxProcess ||
+ !IsTransactionState())
+ {
+ /* reset init state */
+ if (isDisable)
+ plantuner_disable_inited = false;
+ else
+ plantuner_enable_inited = false;
+
+ return newval;
+ }
+
if (doit)
{
nOids = list_length(namelist);
if (doit)
{
nOids = list_length(namelist);
@@
-86,14
+104,6
@@
indexesAssign(const char * newval, bool doit, GucSource source, bool isDisable)
(int)(sizeof(Oid) * (nOids+1)));
}
(int)(sizeof(Oid) * (nOids+1)));
}
- /*
- * follow work could be done only in normal processing because of
- * accsess to system catalog
- */
- if (MyBackendId == InvalidBackendId || !IsUnderPostmaster ||
- !IsNormalProcessingMode() || MyAuxProcType != NotAnAuxProcess)
- return newval;
-
if (isDisable)
plantuner_disable_inited = true;
else
if (isDisable)
plantuner_disable_inited = true;
else