diff options
| author | Bruce Momjian | 2002-09-04 20:31:48 +0000 |
|---|---|---|
| committer | Bruce Momjian | 2002-09-04 20:31:48 +0000 |
| commit | e50f52a074bdf0d6a9dc384840e641c4c0b0bb1a (patch) | |
| tree | ab73e8c8ec94a6ddc774c1f9c49b87aa6b93fd13 /src/backend/rewrite | |
| parent | c91ceec21d357d6d857163d897ac75a79c883dee (diff) | |
pgindent run.
Diffstat (limited to 'src/backend/rewrite')
| -rw-r--r-- | src/backend/rewrite/rewriteDefine.c | 49 | ||||
| -rw-r--r-- | src/backend/rewrite/rewriteHandler.c | 44 | ||||
| -rw-r--r-- | src/backend/rewrite/rewriteManip.c | 24 | ||||
| -rw-r--r-- | src/backend/rewrite/rewriteRemove.c | 6 |
4 files changed, 61 insertions, 62 deletions
diff --git a/src/backend/rewrite/rewriteDefine.c b/src/backend/rewrite/rewriteDefine.c index f2761894260..2aa4fdd892e 100644 --- a/src/backend/rewrite/rewriteDefine.c +++ b/src/backend/rewrite/rewriteDefine.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteDefine.c,v 1.78 2002/09/02 02:13:01 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteDefine.c,v 1.79 2002/09/04 20:31:25 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -62,8 +62,8 @@ InsertRule(char *rulname, HeapTuple tup, oldtup; Oid rewriteObjectId; - ObjectAddress myself, - referenced; + ObjectAddress myself, + referenced; bool is_update = false; /* @@ -73,13 +73,13 @@ InsertRule(char *rulname, i = 0; namestrcpy(&rname, rulname); - values[i++] = NameGetDatum(&rname); /* rulename */ - values[i++] = ObjectIdGetDatum(eventrel_oid); /* ev_class */ - values[i++] = Int16GetDatum(evslot_index); /* ev_attr */ - values[i++] = CharGetDatum(evtype + '0'); /* ev_type */ - values[i++] = BoolGetDatum(evinstead); /* is_instead */ - values[i++] = DirectFunctionCall1(textin, CStringGetDatum(evqual)); /* ev_qual */ - values[i++] = DirectFunctionCall1(textin, CStringGetDatum(actiontree)); /* ev_action */ + values[i++] = NameGetDatum(&rname); /* rulename */ + values[i++] = ObjectIdGetDatum(eventrel_oid); /* ev_class */ + values[i++] = Int16GetDatum(evslot_index); /* ev_attr */ + values[i++] = CharGetDatum(evtype + '0'); /* ev_type */ + values[i++] = BoolGetDatum(evinstead); /* is_instead */ + values[i++] = DirectFunctionCall1(textin, CStringGetDatum(evqual)); /* ev_qual */ + values[i++] = DirectFunctionCall1(textin, CStringGetDatum(actiontree)); /* ev_action */ /* * Ready to store new pg_rewrite tuple @@ -97,7 +97,7 @@ InsertRule(char *rulname, if (HeapTupleIsValid(oldtup)) { if (!replace) - elog(ERROR,"Attempt to insert rule \"%s\" failed: already exists", + elog(ERROR, "Attempt to insert rule \"%s\" failed: already exists", rulname); /* @@ -138,8 +138,8 @@ InsertRule(char *rulname, rewriteObjectId); /* - * Install dependency on rule's relation to ensure it will go away - * on relation deletion. If the rule is ON SELECT, make the dependency + * Install dependency on rule's relation to ensure it will go away on + * relation deletion. If the rule is ON SELECT, make the dependency * implicit --- this prevents deleting a view's SELECT rule. Other * kinds of rules can be AUTO. */ @@ -152,7 +152,7 @@ InsertRule(char *rulname, referenced.objectSubId = 0; recordDependencyOn(&myself, &referenced, - (evtype == CMD_SELECT) ? DEPENDENCY_INTERNAL : DEPENDENCY_AUTO); + (evtype == CMD_SELECT) ? DEPENDENCY_INTERNAL : DEPENDENCY_AUTO); /* * Also install dependencies on objects referenced in action and qual. @@ -163,7 +163,7 @@ InsertRule(char *rulname, if (event_qual != NULL) { /* Find query containing OLD/NEW rtable entries */ - Query *qry = (Query *) lfirst(action); + Query *qry = (Query *) lfirst(action); qry = getInsertSelectQuery(qry, NULL); recordDependencyOnExpr(&myself, event_qual, qry->rtable, @@ -272,7 +272,7 @@ DefineQueryRewrite(RuleStmt *stmt) * event relation, ... */ i = 0; - foreach (tllist, query->targetList) + foreach(tllist, query->targetList) { TargetEntry *tle = (TargetEntry *) lfirst(tllist); Resdom *resdom = tle->resdom; @@ -289,11 +289,12 @@ DefineQueryRewrite(RuleStmt *stmt) attname = NameStr(attr->attname); /* - * Disallow dropped columns in the relation. This won't happen - * in the cases we actually care about (namely creating a view - * via CREATE TABLE then CREATE RULE). Trying to cope with it - * is much more trouble than it's worth, because we'd have to - * modify the rule to insert dummy NULLs at the right positions. + * Disallow dropped columns in the relation. This won't + * happen in the cases we actually care about (namely creating + * a view via CREATE TABLE then CREATE RULE). Trying to cope + * with it is much more trouble than it's worth, because we'd + * have to modify the rule to insert dummy NULLs at the right + * positions. */ if (attr->attisdropped) elog(ERROR, "cannot convert relation containing dropped columns to view"); @@ -343,11 +344,11 @@ DefineQueryRewrite(RuleStmt *stmt) /* * In versions before 7.3, the expected name was _RETviewname. * For backwards compatibility with old pg_dump output, accept - * that and silently change it to _RETURN. Since this is just + * that and silently change it to _RETURN. Since this is just * a quick backwards-compatibility hack, limit the number of * characters checked to a few less than NAMEDATALEN; this - * saves having to worry about where a multibyte character might - * have gotten truncated. + * saves having to worry about where a multibyte character + * might have gotten truncated. */ if (strncmp(stmt->rulename, "_RET", 4) != 0 || strncmp(stmt->rulename + 4, event_obj->relname, diff --git a/src/backend/rewrite/rewriteHandler.c b/src/backend/rewrite/rewriteHandler.c index b183f85f08a..d434e9e2fb8 100644 --- a/src/backend/rewrite/rewriteHandler.c +++ b/src/backend/rewrite/rewriteHandler.c @@ -7,7 +7,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteHandler.c,v 1.107 2002/08/29 06:05:27 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteHandler.c,v 1.108 2002/09/04 20:31:25 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -42,7 +42,7 @@ static Query *rewriteRuleAction(Query *parsetree, static List *adjustJoinTreeList(Query *parsetree, bool removert, int rt_index); static void rewriteTargetList(Query *parsetree, Relation target_relation); static TargetEntry *process_matched_tle(TargetEntry *src_tle, - TargetEntry *prior_tle); + TargetEntry *prior_tle); static void markQueryForUpdate(Query *qry, bool skipOldNew); static List *matchLocks(CmdType event, RuleLock *rulelocks, int varno, Query *parsetree); @@ -239,7 +239,7 @@ adjustJoinTreeList(Query *parsetree, bool removert, int rt_index) * then junk fields (these in no particular order). * * We must do items 1 and 2 before firing rewrite rules, else rewritten - * references to NEW.foo will produce wrong or incomplete results. Item 3 + * references to NEW.foo will produce wrong or incomplete results. Item 3 * is not needed for rewriting, but will be needed by the planner, and we * can do it essentially for free while handling items 1 and 2. */ @@ -261,7 +261,7 @@ rewriteTargetList(Query *parsetree, Relation target_relation) for (attrno = 1; attrno <= numattrs; attrno++) { - Form_pg_attribute att_tup = target_relation->rd_att->attrs[attrno-1]; + Form_pg_attribute att_tup = target_relation->rd_att->attrs[attrno - 1]; TargetEntry *new_tle = NULL; /* We can ignore deleted attributes */ @@ -269,7 +269,7 @@ rewriteTargetList(Query *parsetree, Relation target_relation) continue; /* - * Look for targetlist entries matching this attr. We match by + * Look for targetlist entries matching this attr. We match by * resno, but the resname should match too. * * Junk attributes are not candidates to be matched. @@ -291,9 +291,9 @@ rewriteTargetList(Query *parsetree, Relation target_relation) if (new_tle == NULL && commandType == CMD_INSERT) { /* - * Didn't find a matching tlist entry; if it's an INSERT, - * look for a default value, and add a tlist entry computing - * the default if we find one. + * Didn't find a matching tlist entry; if it's an INSERT, look + * for a default value, and add a tlist entry computing the + * default if we find one. */ Node *new_expr; @@ -303,7 +303,7 @@ rewriteTargetList(Query *parsetree, Relation target_relation) new_tle = makeTargetEntry(makeResdom(attrno, att_tup->atttypid, att_tup->atttypmod, - pstrdup(NameStr(att_tup->attname)), + pstrdup(NameStr(att_tup->attname)), false), new_expr); } @@ -448,30 +448,28 @@ build_column_default(Relation rel, int attrno) if (expr == NULL) { /* - * No per-column default, so look for a default for the type itself. + * No per-column default, so look for a default for the type + * itself. */ if (att_tup->attisset) { /* - * Set attributes are represented as OIDs no matter what the set - * element type is, and the element type's default is irrelevant - * too. + * Set attributes are represented as OIDs no matter what the + * set element type is, and the element type's default is + * irrelevant too. */ } else - { expr = get_typdefault(atttype); - } } if (expr == NULL) return NULL; /* No default anywhere */ /* - * Make sure the value is coerced to the target column - * type (might not be right type yet if it's not a - * constant!) This should match the parser's processing of - * non-defaulted expressions --- see + * Make sure the value is coerced to the target column type (might not + * be right type yet if it's not a constant!) This should match the + * parser's processing of non-defaulted expressions --- see * updateTargetListEntry(). */ exprtype = exprType(expr); @@ -482,8 +480,8 @@ build_column_default(Relation rel, int attrno) atttype, atttypmod, false); /* - * This really shouldn't fail; should have checked the - * default's type when it was created ... + * This really shouldn't fail; should have checked the default's + * type when it was created ... */ if (expr == NULL) elog(ERROR, "Column \"%s\" is of type %s" @@ -495,8 +493,8 @@ build_column_default(Relation rel, int attrno) } /* - * If the column is a fixed-length type, it may need a - * length coercion as well as a type coercion. + * If the column is a fixed-length type, it may need a length coercion + * as well as a type coercion. */ expr = coerce_type_typmod(NULL, expr, atttype, atttypmod); diff --git a/src/backend/rewrite/rewriteManip.c b/src/backend/rewrite/rewriteManip.c index 87fe1c95264..16eef1bfb85 100644 --- a/src/backend/rewrite/rewriteManip.c +++ b/src/backend/rewrite/rewriteManip.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteManip.c,v 1.64 2002/06/20 20:29:34 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteManip.c,v 1.65 2002/09/04 20:31:25 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -142,7 +142,7 @@ OffsetVarNodes_walker(Node *node, OffsetVarNodes_context *context) } if (IsA(node, JoinExpr)) { - JoinExpr *j = (JoinExpr *) node; + JoinExpr *j = (JoinExpr *) node; if (context->sublevels_up == 0) j->rtindex += context->offset; @@ -251,7 +251,7 @@ ChangeVarNodes_walker(Node *node, ChangeVarNodes_context *context) } if (IsA(node, JoinExpr)) { - JoinExpr *j = (JoinExpr *) node; + JoinExpr *j = (JoinExpr *) node; if (context->sublevels_up == 0 && j->rtindex == context->rt_index) @@ -429,7 +429,7 @@ rangeTableEntry_used_walker(Node *node, } if (IsA(node, JoinExpr)) { - JoinExpr *j = (JoinExpr *) node; + JoinExpr *j = (JoinExpr *) node; if (j->rtindex == context->rt_index && context->sublevels_up == 0) @@ -573,10 +573,10 @@ getInsertSelectQuery(Query *parsetree, Query ***subquery_ptr) * they've been pushed down to the SELECT. */ if (length(parsetree->rtable) >= 2 && - strcmp(rt_fetch(PRS2_OLD_VARNO, parsetree->rtable)->eref->aliasname, - "*OLD*") == 0 && - strcmp(rt_fetch(PRS2_NEW_VARNO, parsetree->rtable)->eref->aliasname, - "*NEW*") == 0) + strcmp(rt_fetch(PRS2_OLD_VARNO, parsetree->rtable)->eref->aliasname, + "*OLD*") == 0 && + strcmp(rt_fetch(PRS2_NEW_VARNO, parsetree->rtable)->eref->aliasname, + "*NEW*") == 0) return parsetree; Assert(parsetree->jointree && IsA(parsetree->jointree, FromExpr)); if (length(parsetree->jointree->fromlist) != 1) @@ -589,10 +589,10 @@ getInsertSelectQuery(Query *parsetree, Query ***subquery_ptr) selectquery->commandType == CMD_SELECT)) elog(ERROR, "getInsertSelectQuery: expected to find SELECT subquery"); if (length(selectquery->rtable) >= 2 && - strcmp(rt_fetch(PRS2_OLD_VARNO, selectquery->rtable)->eref->aliasname, - "*OLD*") == 0 && - strcmp(rt_fetch(PRS2_NEW_VARNO, selectquery->rtable)->eref->aliasname, - "*NEW*") == 0) + strcmp(rt_fetch(PRS2_OLD_VARNO, selectquery->rtable)->eref->aliasname, + "*OLD*") == 0 && + strcmp(rt_fetch(PRS2_NEW_VARNO, selectquery->rtable)->eref->aliasname, + "*NEW*") == 0) { if (subquery_ptr) *subquery_ptr = &(selectrte->subquery); diff --git a/src/backend/rewrite/rewriteRemove.c b/src/backend/rewrite/rewriteRemove.c index 1fd5f36ce55..deb46128cad 100644 --- a/src/backend/rewrite/rewriteRemove.c +++ b/src/backend/rewrite/rewriteRemove.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteRemove.c,v 1.52 2002/07/20 05:16:58 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteRemove.c,v 1.53 2002/09/04 20:31:25 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -85,8 +85,8 @@ void RemoveRewriteRuleById(Oid ruleOid) { Relation RewriteRelation; - ScanKeyData skey[1]; - SysScanDesc rcscan; + ScanKeyData skey[1]; + SysScanDesc rcscan; Relation event_relation; HeapTuple tuple; Oid eventRelationOid; |
