Definition at line 356 of file view.c.
382 elog(
ERROR,
"unexpected parse analysis result");
386 (
errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
387 errmsg(
"views must not contain SELECT INTO")));
389 elog(
ERROR,
"unexpected parse analysis result");
396 if (viewParse->hasModifyingCTE)
398 (
errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
399 errmsg(
"views must not contain data-modifying statements in WITH")));
418 check_option =
false;
420 foreach(cell,
stmt->options)
424 if (strcmp(defel->
defname,
"check_option") == 0)
434 const char *view_updatable_error =
437 if (view_updatable_error)
439 (
errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
440 errmsg(
"WITH CHECK OPTION is supported only on automatically updatable views"),
441 errhint(
"%s",
_(view_updatable_error))));
461 alist_item =
lnext(
stmt->aliases, alist_item);
462 if (alist_item == NULL)
466 if (alist_item != NULL)
468 (
errcode(ERRCODE_SYNTAX_ERROR),
469 errmsg(
"CREATE VIEW specifies more column "
470 "names than columns")));
474 if (
stmt->view->relpersistence == RELPERSISTENCE_UNLOGGED)
476 (
errcode(ERRCODE_SYNTAX_ERROR),
477 errmsg(
"views cannot be unlogged because they do not have storage")));
491 (
errmsg(
"view \"%s\" will be a temporary view",
502 stmt->replace,
stmt->options, viewParse);
int errhint(const char *fmt,...)
int errcode(int sqlerrcode)
int errmsg(const char *fmt,...)
#define ereport(elevel,...)
List * lappend(List *list, void *datum)
DefElem * makeDefElem(char *name, Node *arg, int location)
char * pstrdup(const char *in)
#define IsA(nodeptr, _type_)
bool isQueryUsingTempRelation(Query *query)
Query * parse_analyze_fixedparams(RawStmt *parseTree, const char *sourceText, const Oid *paramTypes, int numParams, QueryEnvironment *queryEnv)
#define lfirst_node(type, lc)
static ListCell * list_head(const List *l)
static ListCell * lnext(const List *l, const ListCell *c)
const char * view_query_is_auto_updatable(Query *viewquery, bool check_cols)
String * makeString(char *str)
static ObjectAddress DefineVirtualRelation(RangeVar *relation, List *tlist, bool replace, List *options, Query *viewParse)
References _, CASCADED_CHECK_OPTION, CMD_SELECT, Query::commandType, copyObject, DefineVirtualRelation(), DefElem::defname, elog, ereport, errcode(), errhint(), errmsg(), ERROR, IsA, isQueryUsingTempRelation(), lappend(), lfirst, lfirst_node, list_head(), lnext(), LOCAL_CHECK_OPTION, makeDefElem(), makeNode, makeString(), NIL, NOTICE, parse_analyze_fixedparams(), pstrdup(), RangeVar::relname, RangeVar::relpersistence, RawStmt::stmt, stmt, RawStmt::stmt_len, RawStmt::stmt_location, strVal, Query::targetList, Query::utilityStmt, and view_query_is_auto_updatable().
Referenced by ProcessUtilitySlow().