summaryrefslogtreecommitdiff
path: root/src/backend/parser/parse_relation.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/parser/parse_relation.c')
-rw-r--r--src/backend/parser/parse_relation.c56
1 files changed, 28 insertions, 28 deletions
diff --git a/src/backend/parser/parse_relation.c b/src/backend/parser/parse_relation.c
index 562c2f54f92..0b2dacfd593 100644
--- a/src/backend/parser/parse_relation.c
+++ b/src/backend/parser/parse_relation.c
@@ -530,8 +530,8 @@ updateFuzzyAttrMatchState(int fuzzy_rte_penalty,
FuzzyAttrMatchState *fuzzystate, RangeTblEntry *rte,
const char *actual, const char *match, int attnum)
{
- int columndistance;
- int matchlen;
+ int columndistance;
+ int matchlen;
/* Bail before computing the Levenshtein distance if there's no hope. */
if (fuzzy_rte_penalty > fuzzystate->distance)
@@ -550,7 +550,7 @@ updateFuzzyAttrMatchState(int fuzzy_rte_penalty,
varstr_levenshtein_less_equal(actual, strlen(actual), match, matchlen,
1, 1, 1,
fuzzystate->distance + 1
- - fuzzy_rte_penalty);
+ - fuzzy_rte_penalty);
/*
* If more than half the characters are different, don't treat it as a
@@ -560,8 +560,8 @@ updateFuzzyAttrMatchState(int fuzzy_rte_penalty,
return;
/*
- * From this point on, we can ignore the distinction between the
- * RTE-name distance and the column-name distance.
+ * From this point on, we can ignore the distinction between the RTE-name
+ * distance and the column-name distance.
*/
columndistance += fuzzy_rte_penalty;
@@ -581,11 +581,11 @@ updateFuzzyAttrMatchState(int fuzzy_rte_penalty,
else if (columndistance == fuzzystate->distance)
{
/*
- * This match distance may equal a prior match within this same
- * range table. When that happens, the prior match may also be
- * given, but only if there is no more than two equally distant
- * matches from the RTE (in turn, our caller will only accept
- * two equally distant matches overall).
+ * This match distance may equal a prior match within this same range
+ * table. When that happens, the prior match may also be given, but
+ * only if there is no more than two equally distant matches from the
+ * RTE (in turn, our caller will only accept two equally distant
+ * matches overall).
*/
if (AttributeNumberIsValid(fuzzystate->second))
{
@@ -606,9 +606,9 @@ updateFuzzyAttrMatchState(int fuzzy_rte_penalty,
else if (fuzzystate->distance <= MAX_FUZZY_DISTANCE)
{
/*
- * Record as provisional first match (this can occasionally
- * occur because previous lowest distance was "too low a
- * bar", rather than being associated with a real match)
+ * Record as provisional first match (this can occasionally occur
+ * because previous lowest distance was "too low a bar", rather
+ * than being associated with a real match)
*/
fuzzystate->rfirst = rte;
fuzzystate->first = attnum;
@@ -820,8 +820,8 @@ searchRangeTableForCol(ParseState *pstate, const char *alias, char *colname,
foreach(l, pstate->p_rtable)
{
- RangeTblEntry *rte = (RangeTblEntry *) lfirst(l);
- int fuzzy_rte_penalty = 0;
+ RangeTblEntry *rte = (RangeTblEntry *) lfirst(l);
+ int fuzzy_rte_penalty = 0;
/*
* Typically, it is not useful to look for matches within join
@@ -851,7 +851,7 @@ searchRangeTableForCol(ParseState *pstate, const char *alias, char *colname,
*/
if (scanRTEForColumn(orig_pstate, rte, colname, location,
fuzzy_rte_penalty, fuzzystate)
- && fuzzy_rte_penalty == 0)
+ && fuzzy_rte_penalty == 0)
{
fuzzystate->rfirst = rte;
fuzzystate->first = InvalidAttrNumber;
@@ -3040,8 +3040,8 @@ void
errorMissingColumn(ParseState *pstate,
char *relname, char *colname, int location)
{
- FuzzyAttrMatchState *state;
- char *closestfirst = NULL;
+ FuzzyAttrMatchState *state;
+ char *closestfirst = NULL;
/*
* Search the entire rtable looking for possible matches. If we find one,
@@ -3056,10 +3056,10 @@ errorMissingColumn(ParseState *pstate,
* Extract closest col string for best match, if any.
*
* Infer an exact match referenced despite not being visible from the fact
- * that an attribute number was not present in state passed back -- this is
- * what is reported when !closestfirst. There might also be an exact match
- * that was qualified with an incorrect alias, in which case closestfirst
- * will be set (so hint is the same as generic fuzzy case).
+ * that an attribute number was not present in state passed back -- this
+ * is what is reported when !closestfirst. There might also be an exact
+ * match that was qualified with an incorrect alias, in which case
+ * closestfirst will be set (so hint is the same as generic fuzzy case).
*/
if (state->rfirst && AttributeNumberIsValid(state->first))
closestfirst = strVal(list_nth(state->rfirst->eref->colnames,
@@ -3074,19 +3074,19 @@ errorMissingColumn(ParseState *pstate,
ereport(ERROR,
(errcode(ERRCODE_UNDEFINED_COLUMN),
relname ?
- errmsg("column %s.%s does not exist", relname, colname):
+ errmsg("column %s.%s does not exist", relname, colname) :
errmsg("column \"%s\" does not exist", colname),
state->rfirst ? closestfirst ?
- errhint("Perhaps you meant to reference the column \"%s\".\"%s\".",
- state->rfirst->eref->aliasname, closestfirst):
+ errhint("Perhaps you meant to reference the column \"%s\".\"%s\".",
+ state->rfirst->eref->aliasname, closestfirst) :
errhint("There is a column named \"%s\" in table \"%s\", but it cannot be referenced from this part of the query.",
- colname, state->rfirst->eref->aliasname): 0,
+ colname, state->rfirst->eref->aliasname) : 0,
parser_errposition(pstate, location)));
}
else
{
/* Handle case where there are two equally useful column hints */
- char *closestsecond;
+ char *closestsecond;
closestsecond = strVal(list_nth(state->rsecond->eref->colnames,
state->second - 1));
@@ -3094,7 +3094,7 @@ errorMissingColumn(ParseState *pstate,
ereport(ERROR,
(errcode(ERRCODE_UNDEFINED_COLUMN),
relname ?
- errmsg("column %s.%s does not exist", relname, colname):
+ errmsg("column %s.%s does not exist", relname, colname) :
errmsg("column \"%s\" does not exist", colname),
errhint("Perhaps you meant to reference the column \"%s\".\"%s\" or the column \"%s\".\"%s\".",
state->rfirst->eref->aliasname, closestfirst,