Rollback GUC change in createas.c
This commit is contained in:
parent
eefb16763e
commit
1901c99f21
1 changed files with 8 additions and 0 deletions
|
|
@ -1712,6 +1712,7 @@ StoreImmvQuery(Oid viewOid, Query *viewQuery)
|
|||
{
|
||||
char *querytree = nodeToString((Node *) viewQuery);
|
||||
char *querystring;
|
||||
int save_nestlevel;
|
||||
Datum values[Natts_pg_ivm_immv];
|
||||
bool isNulls[Natts_pg_ivm_immv];
|
||||
Relation matviewRel;
|
||||
|
|
@ -1720,10 +1721,17 @@ StoreImmvQuery(Oid viewOid, Query *viewQuery)
|
|||
HeapTuple heapTuple;
|
||||
ObjectAddress address;
|
||||
|
||||
/*
|
||||
* Restrict search_path so that pg_ivm_get_viewdef_internal returns a
|
||||
* fully-qualified query.
|
||||
*/
|
||||
save_nestlevel = NewGUCNestLevel();
|
||||
RestrictSearchPath();
|
||||
matviewRel = table_open(viewOid, AccessShareLock);
|
||||
querystring = pg_ivm_get_viewdef_internal(viewQuery, matviewRel, true);
|
||||
table_close(matviewRel, NoLock);
|
||||
/* Roll back the search_path change. */
|
||||
AtEOXact_GUC(false, save_nestlevel);
|
||||
|
||||
memset(values, 0, sizeof(values));
|
||||
memset(isNulls, false, sizeof(isNulls));
|
||||
|
|
|
|||
Loading…
Reference in a new issue