Definition at line 355 of file view.c.
357{
362 bool check_option;
365
366
367
368
369
372 rawstmt->stmt_location = stmt_location;
374
376
377
378
379
380
382 elog(
ERROR,
"unexpected parse analysis result");
387 errmsg(
"views must not contain SELECT INTO")));
389 elog(
ERROR,
"unexpected parse analysis result");
390
391
392
393
394
395
399 errmsg(
"views must not contain data-modifying statements in WITH")));
400
401
402
403
404
413
414
415
416
417
418 check_option = false;
419
420 foreach(cell,
stmt->options)
421 {
423
425 check_option = true;
426 }
427
428
429
430
431
432 if (check_option)
433 {
436
440 errmsg(
"WITH CHECK OPTION is supported only on automatically updatable views"),
442 }
443
444
445
446
447
449 {
452
453 foreach(targetList,
viewParse->targetList)
454 {
456
457
458 if (te->resjunk)
459 continue;
463 break;
464 }
465
469 errmsg(
"CREATE VIEW specifies more column "
470 "names than columns")));
471 }
472
473
477 errmsg(
"views cannot be unlogged because they do not have storage")));
478
479
480
481
482
483
484
488 {
491 (
errmsg(
"view \"%s\" will be a temporary view",
495 }
496
497
498
499
500
501
502
505
506 return address;
507}
bool query_uses_temp_object(Query *query, ObjectAddress *temp_object)
int errdetail(const char *fmt,...)
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_)
char * getObjectDescription(const ObjectAddress *object, bool missing_ok)
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, copyObject, DefineVirtualRelation(), elog, ereport, errcode(), errdetail(), errhint(), errmsg(), ERROR, fb(), getObjectDescription(), IsA, lappend(), lfirst, lfirst_node, list_head(), lnext(), LOCAL_CHECK_OPTION, makeDefElem(), makeNode, makeString(), NIL, NOTICE, parse_analyze_fixedparams(), pstrdup(), query_uses_temp_object(), RangeVar::relname, RangeVar::relpersistence, stmt, strVal, and view_query_is_auto_updatable().
Referenced by ProcessUtilitySlow().