Reset shouldInvalidateForeignKeyGraph on failure

cover-local-tables-fkey-graph
Onur Tirtir 2020-12-24 17:11:46 +03:00
parent 51ab536eed
commit 80dde5e94e
1 changed files with 11 additions and 0 deletions

View File

@ -517,6 +517,17 @@ multi_ProcessUtility(PlannedStmt *pstmt,
{ {
PostStandardProcessUtility(parsetree); PostStandardProcessUtility(parsetree);
/*
* We call MarkInvalidateForeignKeyGraph in preprocess without knowing
* that if command would fail or not. However, we don't want to invalidate
* foreign key graph for failed DDL commands, so here we don't call
* InvalidateForeignKeyGraphForDDL.
* On the other hand, we should still reset shouldInvalidateForeignKeyGraph
* flag as next DDL command still relies on this flag to invalidate foreign
* key graph.
*/
shouldInvalidateForeignKeyGraph = false;
PG_RE_THROW(); PG_RE_THROW();
} }
PG_END_TRY(); PG_END_TRY();