diff options
Diffstat (limited to 'src/backend/commands/view.c')
-rw-r--r-- | src/backend/commands/view.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/backend/commands/view.c b/src/backend/commands/view.c index f8dac126439..a6ef94dcefe 100644 --- a/src/backend/commands/view.c +++ b/src/backend/commands/view.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/commands/view.c,v 1.101 2007/06/23 22:12:50 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/commands/view.c,v 1.102 2007/08/27 03:36:08 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -260,14 +260,14 @@ checkViewTupleDesc(TupleDesc newdesc, TupleDesc olddesc) } static void -DefineViewRules(const RangeVar *view, Query *viewParse, bool replace) +DefineViewRules(Oid viewOid, Query *viewParse, bool replace) { /* * Set up the ON SELECT rule. Since the query has already been through * parse analysis, we use DefineQueryRewrite() directly. */ DefineQueryRewrite(pstrdup(ViewSelectRuleName), - (RangeVar *) copyObject((RangeVar *) view), + viewOid, NULL, CMD_SELECT, true, @@ -404,7 +404,9 @@ DefineView(ViewStmt *stmt, const char *queryString) /* * If the user didn't explicitly ask for a temporary view, check whether - * we need one implicitly. + * we need one implicitly. We allow TEMP to be inserted automatically + * as long as the CREATE command is consistent with that --- no explicit + * schema name. */ view = stmt->view; if (!view->istemp && isViewOnTempTable(viewParse)) @@ -441,7 +443,7 @@ DefineView(ViewStmt *stmt, const char *queryString) /* * Now create the rules associated with the view. */ - DefineViewRules(view, viewParse, stmt->replace); + DefineViewRules(viewOid, viewParse, stmt->replace); } /* |