diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2017-06-21 15:35:54 -0400 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2017-06-21 15:35:54 -0400 |
commit | 382ceffdf7f620d8f2d50e451b4167d291ae2348 (patch) | |
tree | f558251492f2c6f86e3566f7a82f9d00509122c2 /src/backend/optimizer/prep/prepunion.c | |
parent | c7b8998ebbf310a156aa38022555a24d98fdbfb4 (diff) | |
download | postgresql-382ceffdf7f620d8f2d50e451b4167d291ae2348.tar.gz postgresql-382ceffdf7f620d8f2d50e451b4167d291ae2348.zip |
Phase 3 of pgindent updates.
Don't move parenthesized lines to the left, even if that means they
flow past the right margin.
By default, BSD indent lines up statement continuation lines that are
within parentheses so that they start just to the right of the preceding
left parenthesis. However, traditionally, if that resulted in the
continuation line extending to the right of the desired right margin,
then indent would push it left just far enough to not overrun the margin,
if it could do so without making the continuation line start to the left of
the current statement indent. That makes for a weird mix of indentations
unless one has been completely rigid about never violating the 80-column
limit.
This behavior has been pretty universally panned by Postgres developers.
Hence, disable it with indent's new -lpl switch, so that parenthesized
lines are always lined up with the preceding left paren.
This patch is much less interesting than the first round of indent
changes, but also bulkier, so I thought it best to separate the effects.
Discussion: https://postgr.es/m/E1dAmxK-0006EE-1r@gemulon.postgresql.org
Discussion: https://postgr.es/m/30527.1495162840@sss.pgh.pa.us
Diffstat (limited to 'src/backend/optimizer/prep/prepunion.c')
-rw-r--r-- | src/backend/optimizer/prep/prepunion.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/backend/optimizer/prep/prepunion.c b/src/backend/optimizer/prep/prepunion.c index 8b44fb96b08..cf46b74782c 100644 --- a/src/backend/optimizer/prep/prepunion.c +++ b/src/backend/optimizer/prep/prepunion.c @@ -356,7 +356,7 @@ recurse_set_operations(Node *setOp, PlannerInfo *root, *pNumGroups = subpath->rows; else *pNumGroups = estimate_num_groups(subroot, - get_tlist_exprs(subquery->targetList, false), + get_tlist_exprs(subquery->targetList, false), subpath->rows, NULL); } @@ -724,14 +724,14 @@ generate_nonunion_path(SetOperationStmt *op, PlannerInfo *root, */ use_hash = choose_hashed_setop(root, groupList, path, dNumGroups, dNumOutputRows, - (op->op == SETOP_INTERSECT) ? "INTERSECT" : "EXCEPT"); + (op->op == SETOP_INTERSECT) ? "INTERSECT" : "EXCEPT"); if (!use_hash) path = (Path *) create_sort_path(root, result_rel, path, make_pathkeys_for_sortclauses(root, - groupList, + groupList, tlist), -1.0); @@ -887,7 +887,7 @@ make_union_unique(SetOperationStmt *op, Path *path, List *tlist, result_rel, path, make_pathkeys_for_sortclauses(root, - groupList, + groupList, tlist), -1.0); /* We have to manually jam the right tlist into the path; ick */ @@ -1527,11 +1527,11 @@ expand_inherited_rtentry(PlannerInfo *root, RangeTblEntry *rte, Index rti) if (childOID != parentOID) { childrte->selectedCols = translate_col_privs(rte->selectedCols, - appinfo->translated_vars); + appinfo->translated_vars); childrte->insertedCols = translate_col_privs(rte->insertedCols, - appinfo->translated_vars); + appinfo->translated_vars); childrte->updatedCols = translate_col_privs(rte->updatedCols, - appinfo->translated_vars); + appinfo->translated_vars); } } else @@ -1740,7 +1740,7 @@ translate_col_privs(const Bitmapset *parent_privs, if (bms_is_member(attno - FirstLowInvalidHeapAttributeNumber, parent_privs)) child_privs = bms_add_member(child_privs, - attno - FirstLowInvalidHeapAttributeNumber); + attno - FirstLowInvalidHeapAttributeNumber); } /* Check if parent has whole-row reference */ @@ -1760,7 +1760,7 @@ translate_col_privs(const Bitmapset *parent_privs, bms_is_member(attno - FirstLowInvalidHeapAttributeNumber, parent_privs)) child_privs = bms_add_member(child_privs, - var->varattno - FirstLowInvalidHeapAttributeNumber); + var->varattno - FirstLowInvalidHeapAttributeNumber); } return child_privs; @@ -1927,7 +1927,7 @@ adjust_appendrel_attrs_mutator(Node *node, JoinExpr *j; j = (JoinExpr *) expression_tree_mutator(node, - adjust_appendrel_attrs_mutator, + adjust_appendrel_attrs_mutator, (void *) context); /* now fix JoinExpr's rtindex (probably never happens) */ if (j->rtindex == appinfo->parent_relid) @@ -1940,7 +1940,7 @@ adjust_appendrel_attrs_mutator(Node *node, PlaceHolderVar *phv; phv = (PlaceHolderVar *) expression_tree_mutator(node, - adjust_appendrel_attrs_mutator, + adjust_appendrel_attrs_mutator, (void *) context); /* now fix PlaceHolderVar's relid sets */ if (phv->phlevelsup == 0) |