1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-15 19:21:59 +03:00

Eliminate pg_rewrite.ev_attr column and related dead code.

Commit 95ef6a3448 removed the
ability to create rules on an individual column as of 7.3, but
left some residual code which has since been useless.  This cleans
up that dead code without any change in behavior other than
dropping the useless column from the catalog.
This commit is contained in:
Kevin Grittner
2013-09-05 14:03:43 -05:00
parent 20cb18db46
commit 277607d600
11 changed files with 9 additions and 125 deletions

View File

@ -1276,10 +1276,7 @@ matchLocks(CmdType event,
if (oneLock->event == event)
{
if (parsetree->commandType != CMD_SELECT ||
(oneLock->attrno == -1 ?
rangeTableEntry_used((Node *) parsetree, varno, 0) :
attribute_used((Node *) parsetree,
varno, oneLock->attrno, 0)))
rangeTableEntry_used((Node *) parsetree, varno, 0))
matching_locks = lappend(matching_locks, oneLock);
}
}
@ -1295,7 +1292,6 @@ static Query *
ApplyRetrieveRule(Query *parsetree,
RewriteRule *rule,
int rt_index,
bool relation_level,
Relation relation,
List *activeRIRs,
bool forUpdatePushedDown)
@ -1309,8 +1305,6 @@ ApplyRetrieveRule(Query *parsetree,
elog(ERROR, "expected just one rule action");
if (rule->qual != NULL)
elog(ERROR, "cannot handle qualified ON SELECT rule");
if (!relation_level)
elog(ERROR, "cannot handle per-attribute ON SELECT rule");
if (rt_index == parsetree->resultRelation)
{
@ -1632,14 +1626,6 @@ fireRIRrules(Query *parsetree, List *activeRIRs, bool forUpdatePushedDown)
if (rule->event != CMD_SELECT)
continue;
if (rule->attrno > 0)
{
/* per-attr rule; do we need it? */
if (!attribute_used((Node *) parsetree, rt_index,
rule->attrno, 0))
continue;
}
locks = lappend(locks, rule);
}
@ -1664,7 +1650,6 @@ fireRIRrules(Query *parsetree, List *activeRIRs, bool forUpdatePushedDown)
parsetree = ApplyRetrieveRule(parsetree,
rule,
rt_index,
rule->attrno == -1,
rel,
activeRIRs,
forUpdatePushedDown);