mirror of
https://github.com/postgres/postgres.git
synced 2025-08-25 20:23:07 +03:00
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
This commit is contained in:
@@ -291,7 +291,7 @@ ExecMakeTableFunctionResult(SetExprState *setexpr,
|
||||
*/
|
||||
oldcontext = MemoryContextSwitchTo(econtext->ecxt_per_query_memory);
|
||||
tupdesc = lookup_rowtype_tupdesc_copy(HeapTupleHeaderGetTypeId(td),
|
||||
HeapTupleHeaderGetTypMod(td));
|
||||
HeapTupleHeaderGetTypMod(td));
|
||||
rsinfo.setDesc = tupdesc;
|
||||
MemoryContextSwitchTo(oldcontext);
|
||||
}
|
||||
@@ -667,10 +667,10 @@ init_sexpr(Oid foid, Oid input_collation, Expr *node,
|
||||
if (list_length(sexpr->args) > FUNC_MAX_ARGS)
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_TOO_MANY_ARGUMENTS),
|
||||
errmsg_plural("cannot pass more than %d argument to a function",
|
||||
"cannot pass more than %d arguments to a function",
|
||||
FUNC_MAX_ARGS,
|
||||
FUNC_MAX_ARGS)));
|
||||
errmsg_plural("cannot pass more than %d argument to a function",
|
||||
"cannot pass more than %d arguments to a function",
|
||||
FUNC_MAX_ARGS,
|
||||
FUNC_MAX_ARGS)));
|
||||
|
||||
/* Set up the primary fmgr lookup information */
|
||||
fmgr_info_cxt(foid, &(sexpr->func), sexprCxt);
|
||||
@@ -687,7 +687,7 @@ init_sexpr(Oid foid, Oid input_collation, Expr *node,
|
||||
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
|
||||
errmsg("set-valued function called in context that cannot accept a set"),
|
||||
parent ? executor_errposition(parent->state,
|
||||
exprLocation((Node *) node)) : 0));
|
||||
exprLocation((Node *) node)) : 0));
|
||||
|
||||
/* Otherwise, caller should have marked the sexpr correctly */
|
||||
Assert(sexpr->func.fn_retset == sexpr->funcReturnsSet);
|
||||
@@ -897,7 +897,7 @@ tupledesc_match(TupleDesc dst_tupdesc, TupleDesc src_tupdesc)
|
||||
(errcode(ERRCODE_DATATYPE_MISMATCH),
|
||||
errmsg("function return row and query-specified return row do not match"),
|
||||
errdetail_plural("Returned row contains %d attribute, but query expects %d.",
|
||||
"Returned row contains %d attributes, but query expects %d.",
|
||||
"Returned row contains %d attributes, but query expects %d.",
|
||||
src_tupdesc->natts,
|
||||
src_tupdesc->natts, dst_tupdesc->natts)));
|
||||
|
||||
|
Reference in New Issue
Block a user