PostgreSQL Source Code
git master
|
#include "postgres.h"
#include "access/heapam.h"
#include "access/xact.h"
#include "catalog/namespace.h"
#include "commands/defrem.h"
#include "commands/tablecmds.h"
#include "commands/view.h"
#include "miscadmin.h"
#include "nodes/makefuncs.h"
#include "nodes/nodeFuncs.h"
#include "parser/analyze.h"
#include "parser/parse_relation.h"
#include "rewrite/rewriteDefine.h"
#include "rewrite/rewriteManip.h"
#include "rewrite/rewriteHandler.h"
#include "rewrite/rewriteSupport.h"
#include "utils/acl.h"
#include "utils/builtins.h"
#include "utils/lsyscache.h"
#include "utils/rel.h"
#include "utils/syscache.h"
Go to the source code of this file.
Functions | |
static void | checkViewTupleDesc (TupleDesc newdesc, TupleDesc olddesc) |
void | validateWithCheckOption (const char *value) |
static ObjectAddress | DefineVirtualRelation (RangeVar *relation, List *tlist, bool replace, List *options, Query *viewParse) |
static void | DefineViewRules (Oid viewOid, Query *viewParse, bool replace) |
static Query * | UpdateRangeTableOfViewParse (Oid viewOid, Query *viewParse) |
ObjectAddress | DefineView (ViewStmt *stmt, const char *queryString, int stmt_location, int stmt_len) |
void | StoreViewQuery (Oid viewOid, Query *viewParse, bool replace) |
Definition at line 274 of file view.c.
References ereport, errcode(), errmsg(), ERROR, format_type_with_typemod(), i, NameStr, tupleDesc::natts, and TupleDescAttr.
Referenced by DefineVirtualRelation().
ObjectAddress DefineView | ( | ViewStmt * | stmt, |
const char * | queryString, | ||
int | stmt_location, | ||
int | stmt_len | ||
) |
Definition at line 417 of file view.c.
References ViewStmt::aliases, CASCADED_CHECK_OPTION, CMD_SELECT, Query::commandType, copyObject, DefineVirtualRelation(), DefElem::defname, elog, ereport, errcode(), errhint(), errmsg(), ERROR, Query::hasModifyingCTE, IsA, isQueryUsingTempRelation(), lappend(), lfirst, lfirst_node, list_head(), lnext, LOCAL_CHECK_OPTION, makeDefElem(), makeNode, makeString(), NIL, NOTICE, ViewStmt::options, parse_analyze(), pstrdup(), ViewStmt::query, RangeVar::relname, RangeVar::relpersistence, ViewStmt::replace, TargetEntry::resjunk, TargetEntry::resname, RawStmt::stmt, RawStmt::stmt_len, RawStmt::stmt_location, strVal, Query::targetList, Query::utilityStmt, ViewStmt::view, view_query_is_auto_updatable(), and ViewStmt::withCheckOption.
Referenced by ProcessUtilitySlow().
Definition at line 323 of file view.c.
References CMD_SELECT, DefineQueryRewrite(), list_make1, pstrdup(), and ViewSelectRuleName.
Referenced by StoreViewQuery().
|
static |
Definition at line 67 of file view.c.
References AccessExclusiveLock, AlterTableInternal(), Assert, AT_AddColumnToView, AT_ReplaceRelOptions, BuildDescForRelation(), CheckTableNotInUse(), checkViewTupleDesc(), ColumnDef::collOid, ColumnDef::colname, CommandCounterIncrement(), CreateStmt::constraints, AlterTableCmd::def, DefineRelation(), ereport, errcode(), errhint(), errmsg(), ERROR, TargetEntry::expr, exprCollation(), exprType(), exprTypmod(), CreateStmt::if_not_exists, CreateStmt::inhRelations, InvalidOid, lappend(), lfirst, list_length(), list_make1, makeColumnDef(), makeNode, tupleDesc::natts, NIL, NoLock, ObjectAddressSet, ObjectAddress::objectId, OidIsValid, CreateStmt::oncommit, ONCOMMIT_NOOP, options, CreateStmt::options, RangeVarGetAndCheckCreationNamespace(), RelationData::rd_att, RelationData::rd_rel, CreateStmt::relation, relation_close(), relation_open(), RelationGetRelationName, RangeVar::relpersistence, TargetEntry::resjunk, TargetEntry::resname, skip, StoreViewQuery(), AlterTableCmd::subtype, CreateStmt::tableElts, CreateStmt::tablespacename, and type_is_collatable().
Referenced by DefineView().
Definition at line 575 of file view.c.
References DefineViewRules(), and UpdateRangeTableOfViewParse().
Referenced by create_ctas_internal(), and DefineVirtualRelation().
Definition at line 360 of file view.c.
References AccessShareLock, addRangeTableEntryForRelation(), copyObject, lcons(), make_parsestate(), makeAlias(), NIL, OffsetVarNodes(), relation_close(), relation_open(), RangeTblEntry::requiredPerms, and Query::rtable.
Referenced by StoreViewQuery().