mirror of
https://github.com/postgres/postgres.git
synced 2025-07-28 23:42:10 +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:
@ -537,7 +537,7 @@ add_reloption_kind(void)
|
||||
if (last_assigned_kind >= RELOPT_KIND_MAX)
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),
|
||||
errmsg("user-defined relation parameter types limit exceeded")));
|
||||
errmsg("user-defined relation parameter types limit exceeded")));
|
||||
last_assigned_kind <<= 1;
|
||||
return (relopt_kind) last_assigned_kind;
|
||||
}
|
||||
@ -567,7 +567,7 @@ add_reloption(relopt_gen *newoption)
|
||||
{
|
||||
max_custom_options *= 2;
|
||||
custom_options = repalloc(custom_options,
|
||||
max_custom_options * sizeof(relopt_gen *));
|
||||
max_custom_options * sizeof(relopt_gen *));
|
||||
}
|
||||
MemoryContextSwitchTo(oldcxt);
|
||||
}
|
||||
@ -818,7 +818,7 @@ transformRelOptions(Datum oldOptions, List *defList, char *namspace,
|
||||
if (def->arg != NULL)
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_SYNTAX_ERROR),
|
||||
errmsg("RESET must not include values for parameters")));
|
||||
errmsg("RESET must not include values for parameters")));
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1137,8 +1137,8 @@ parse_one_reloption(relopt_value *option, char *text_str, int text_len,
|
||||
if (validate && !parsed)
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
|
||||
errmsg("invalid value for boolean option \"%s\": %s",
|
||||
option->gen->name, value)));
|
||||
errmsg("invalid value for boolean option \"%s\": %s",
|
||||
option->gen->name, value)));
|
||||
}
|
||||
break;
|
||||
case RELOPT_TYPE_INT:
|
||||
@ -1149,16 +1149,16 @@ parse_one_reloption(relopt_value *option, char *text_str, int text_len,
|
||||
if (validate && !parsed)
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
|
||||
errmsg("invalid value for integer option \"%s\": %s",
|
||||
option->gen->name, value)));
|
||||
errmsg("invalid value for integer option \"%s\": %s",
|
||||
option->gen->name, value)));
|
||||
if (validate && (option->values.int_val < optint->min ||
|
||||
option->values.int_val > optint->max))
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
|
||||
errmsg("value %s out of bounds for option \"%s\"",
|
||||
value, option->gen->name),
|
||||
errdetail("Valid values are between \"%d\" and \"%d\".",
|
||||
optint->min, optint->max)));
|
||||
errmsg("value %s out of bounds for option \"%s\"",
|
||||
value, option->gen->name),
|
||||
errdetail("Valid values are between \"%d\" and \"%d\".",
|
||||
optint->min, optint->max)));
|
||||
}
|
||||
break;
|
||||
case RELOPT_TYPE_REAL:
|
||||
@ -1175,10 +1175,10 @@ parse_one_reloption(relopt_value *option, char *text_str, int text_len,
|
||||
option->values.real_val > optreal->max))
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
|
||||
errmsg("value %s out of bounds for option \"%s\"",
|
||||
value, option->gen->name),
|
||||
errdetail("Valid values are between \"%f\" and \"%f\".",
|
||||
optreal->min, optreal->max)));
|
||||
errmsg("value %s out of bounds for option \"%s\"",
|
||||
value, option->gen->name),
|
||||
errdetail("Valid values are between \"%f\" and \"%f\".",
|
||||
optreal->min, optreal->max)));
|
||||
}
|
||||
break;
|
||||
case RELOPT_TYPE_STRING:
|
||||
|
Reference in New Issue
Block a user