PostgreSQL Source Code
git master
|
Go to the source code of this file.
Macros | |
#define | RULE_FIRES_ON_ORIGIN 'O' |
#define | RULE_FIRES_ALWAYS 'A' |
#define | RULE_FIRES_ON_REPLICA 'R' |
#define | RULE_DISABLED 'D' |
Functions | |
ObjectAddress | DefineRule (RuleStmt *stmt, const char *queryString) |
ObjectAddress | DefineQueryRewrite (const char *rulename, Oid event_relid, Node *event_qual, CmdType event_type, bool is_instead, bool replace, List *action) |
ObjectAddress | RenameRewriteRule (RangeVar *relation, const char *oldName, const char *newName) |
void | setRuleCheckAsUser (Node *node, Oid userid) |
void | EnableDisableRule (Relation rel, const char *rulename, char fires_when) |
#define RULE_DISABLED 'D' |
Definition at line 24 of file rewriteDefine.h.
#define RULE_FIRES_ALWAYS 'A' |
Definition at line 22 of file rewriteDefine.h.
#define RULE_FIRES_ON_ORIGIN 'O' |
Definition at line 21 of file rewriteDefine.h.
#define RULE_FIRES_ON_REPLICA 'R' |
Definition at line 23 of file rewriteDefine.h.
ObjectAddress DefineQueryRewrite | ( | const char * | rulename, |
Oid | event_relid, | ||
Node * | event_qual, | ||
CmdType | event_type, | ||
bool | is_instead, | ||
bool | replace, | ||
List * | action | ||
) |
Definition at line 224 of file rewriteDefine.c.
References AccessExclusiveLock, aclcheck_error(), ACLCHECK_NOT_OWNER, generate_unaccent_rules::action, allowSystemTableMods, checkRuleResultList(), CMD_SELECT, Query::commandType, ereport, errcode(), errdetail_relkind_not_supported(), errhint(), errmsg(), ERROR, get_relkind_objtype(), getInsertSelectQuery(), GetUserId(), i, InsertRule(), InvalidOid, IsSystemRelation(), lfirst_node, linitial_node, list_length(), NAMEDATALEN, NIL, NoLock, RuleLock::numLocks, object_ownercheck(), ObjectAddressSet, PRS2_NEW_VARNO, PRS2_OLD_VARNO, pstrdup(), RelationData::rd_rel, RelationData::rd_rules, RelationGetDescr, RelationGetRelationName, Query::returningList, RuleLock::rules, SetRelationRuleStatus(), table_close(), table_open(), Query::targetList, and ViewSelectRuleName.
Referenced by DefineRule(), and DefineViewRules().
ObjectAddress DefineRule | ( | RuleStmt * | stmt, |
const char * | queryString | ||
) |
Definition at line 190 of file rewriteDefine.c.
References AccessExclusiveLock, DefineQueryRewrite(), RangeVarGetRelid, stmt, and transformRuleStmt().
Referenced by ProcessUtilitySlow().
void EnableDisableRule | ( | Relation | rel, |
const char * | rulename, | ||
char | fires_when | ||
) |
Definition at line 691 of file rewriteDefine.c.
References aclcheck_error(), ACLCHECK_NOT_OWNER, Assert, CacheInvalidateRelcache(), CatalogTupleUpdate(), CharGetDatum(), DatumGetChar(), ereport, errcode(), errmsg(), ERROR, get_rel_name(), get_rel_relkind(), get_relkind_objtype(), GETSTRUCT, GetUserId(), heap_freetuple(), HeapTupleIsValid, InvokeObjectPostAlterHook, object_ownercheck(), ObjectIdGetDatum(), PointerGetDatum(), RelationGetRelid, RowExclusiveLock, SearchSysCacheCopy2, HeapTupleData::t_self, table_close(), and table_open().
Referenced by ATExecEnableDisableRule().
ObjectAddress RenameRewriteRule | ( | RangeVar * | relation, |
const char * | oldName, | ||
const char * | newName | ||
) |
Definition at line 793 of file rewriteDefine.c.
References AccessExclusiveLock, CacheInvalidateRelcache(), CatalogTupleUpdate(), CMD_SELECT, ereport, errcode(), ERRCODE_DUPLICATE_OBJECT, errmsg(), ERROR, GETSTRUCT, heap_freetuple(), HeapTupleIsValid, InvokeObjectPostAlterHook, IsDefinedRewriteRule(), namestrcpy(), NoLock, ObjectAddressSet, ObjectIdGetDatum(), PointerGetDatum(), RangeVarCallbackForRenameRule(), RangeVarGetRelidExtended(), relation_close(), relation_open(), RelationGetRelationName, RowExclusiveLock, SearchSysCacheCopy2, HeapTupleData::t_self, table_close(), and table_open().
Referenced by ExecRenameStmt().
Definition at line 631 of file rewriteDefine.c.
References setRuleCheckAsUser_walker().
Referenced by get_row_security_policies(), and RelationBuildRuleLock().