77 errmsg(
"could not determine which collation to use for view column \"%s\"",
79 errhint(
"Use the COLLATE clause to set the collation explicitly.")));
112 errmsg(
"\"%s\" is not a view",
273 errmsg(
"cannot drop columns from view")));
284 errmsg(
"cannot drop columns from view")));
289 errmsg(
"cannot change name of view column \"%s\" to \"%s\"",
292 errhint(
"Use ALTER VIEW ... RENAME COLUMN ... to change name of view column instead.")));
303 errmsg(
"cannot change data type of view column \"%s\" from %s to %s",
317 errmsg(
"cannot change collation of view column \"%s\" from \"%s\" to \"%s\"",
356 int stmt_location,
int stmt_len)
372 rawstmt->stmt_location = stmt_location;
382 elog(
ERROR,
"unexpected parse analysis result");
387 errmsg(
"views must not contain SELECT INTO")));
389 elog(
ERROR,
"unexpected parse analysis result");
399 errmsg(
"views must not contain data-modifying statements in WITH")));
418 check_option =
false;
420 foreach(cell,
stmt->options)
440 errmsg(
"WITH CHECK OPTION is supported only on automatically updatable views"),
453 foreach(targetList,
viewParse->targetList)
469 errmsg(
"CREATE VIEW specifies more column "
470 "names than columns")));
477 errmsg(
"views cannot be unlogged because they do not have storage")));
491 (
errmsg(
"view \"%s\" will be a temporary view",
#define Assert(condition)
#define OidIsValid(objectId)
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)
#define AccessExclusiveLock
char * get_collation_name(Oid colloid)
bool type_is_collatable(Oid typid)
DefElem * makeDefElem(char *name, Node *arg, int location)
ColumnDef * makeColumnDef(const char *colname, Oid typeOid, int32 typmod, Oid collOid)
char * pstrdup(const char *in)
Oid RangeVarGetAndCheckCreationNamespace(RangeVar *relation, LOCKMODE lockmode, Oid *existing_relation_id)
Oid exprType(const Node *expr)
int32 exprTypmod(const Node *expr)
Oid exprCollation(const Node *expr)
#define IsA(nodeptr, _type_)
char * getObjectDescription(const ObjectAddress *object, bool missing_ok)
#define ObjectAddressSet(addr, class_id, object_id)
Query * parse_analyze_fixedparams(RawStmt *parseTree, const char *sourceText, const Oid *paramTypes, int numParams, QueryEnvironment *queryEnv)
FormData_pg_attribute * Form_pg_attribute
static const struct exclude_list_item skip[]
void recordDependencyOnCurrentExtension(const ObjectAddress *object, bool isReplace)
#define lfirst_node(type, lc)
static int list_length(const List *l)
static ListCell * list_head(const List *l)
static ListCell * lnext(const List *l, const ListCell *c)
#define RelationGetRelationName(relation)
ObjectAddress DefineQueryRewrite(const char *rulename, Oid event_relid, Node *event_qual, CmdType event_type, bool is_instead, bool replace, List *action)
const char * view_query_is_auto_updatable(Query *viewquery, bool check_cols)
#define ViewSelectRuleName
void relation_close(Relation relation, LOCKMODE lockmode)
Relation relation_open(Oid relationId, LOCKMODE lockmode)
TupleDesc BuildDescForRelation(const List *columns)
void CheckTableNotInUse(Relation rel, const char *stmt)
ObjectAddress DefineRelation(CreateStmt *stmt, char relkind, Oid ownerId, ObjectAddress *typaddress, const char *queryString)
void AlterTableInternal(Oid relid, List *cmds, bool recurse)
static FormData_pg_attribute * TupleDescAttr(TupleDesc tupdesc, int i)
String * makeString(char *str)
static ObjectAddress DefineVirtualRelation(RangeVar *relation, List *tlist, bool replace, List *options, Query *viewParse)
static void checkViewColumns(TupleDesc newdesc, TupleDesc olddesc)
static void DefineViewRules(Oid viewOid, Query *viewParse, bool replace)
ObjectAddress DefineView(ViewStmt *stmt, const char *queryString, int stmt_location, int stmt_len)
void StoreViewQuery(Oid viewOid, Query *viewParse, bool replace)
void CommandCounterIncrement(void)