aboutsummaryrefslogtreecommitdiff
path: root/src/backend/executor/execMain.c
diff options
context:
space:
mode:
authorKevin Grittner <kgrittn@postgresql.org>2013-11-02 18:38:17 -0500
committerKevin Grittner <kgrittn@postgresql.org>2013-11-02 18:38:17 -0500
commitbe420fa02e69f084a0eeac6d2cb5424551aad495 (patch)
tree9b8a5ba9ac079a89461faf6f8415b7139f15a5fd /src/backend/executor/execMain.c
parent24ace4053d42e2c48af8c15d598622e488fb9502 (diff)
downloadpostgresql-be420fa02e69f084a0eeac6d2cb5424551aad495.tar.gz
postgresql-be420fa02e69f084a0eeac6d2cb5424551aad495.zip
Fix subquery reference to non-populated MV in CMV.
A subquery reference to a matview should be allowed by CREATE MATERIALIZED VIEW WITH NO DATA, just like a direct reference is. Per bug report from Laurent Sartran. Backpatch to 9.3.
Diffstat (limited to 'src/backend/executor/execMain.c')
-rw-r--r--src/backend/executor/execMain.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/backend/executor/execMain.c b/src/backend/executor/execMain.c
index 791f3361d72..0b4710646aa 100644
--- a/src/backend/executor/execMain.c
+++ b/src/backend/executor/execMain.c
@@ -865,7 +865,8 @@ InitPlan(QueryDesc *queryDesc, int eflags)
* it is a parameterless subplan (not initplan), we suggest that it be
* prepared to handle REWIND efficiently; otherwise there is no need.
*/
- sp_eflags = eflags & EXEC_FLAG_EXPLAIN_ONLY;
+ sp_eflags = eflags
+ & (EXEC_FLAG_EXPLAIN_ONLY | EXEC_FLAG_WITH_NO_DATA);
if (bms_is_member(i, plannedstmt->rewindPlanIDs))
sp_eflags |= EXEC_FLAG_REWIND;