]> granicus.if.org Git - postgresql/commit
Suggest to the user the column they may have meant to reference.
authorRobert Haas <rhaas@postgresql.org>
Wed, 11 Mar 2015 14:44:04 +0000 (10:44 -0400)
committerRobert Haas <rhaas@postgresql.org>
Wed, 11 Mar 2015 14:44:04 +0000 (10:44 -0400)
commite529cd4ffa605c6f14f1391af5559b3a44da0336
treeedc9c0a16e48514e4f6570e2ecee56fff29e4ea6
parentbbfd7edae5aa5ad5553d3c7e102f2e450d4380d4
Suggest to the user the column they may have meant to reference.

Error messages informing the user that no such column exists can
sometimes provoke a perplexed response.  This often happens due to
a subtle typo in the column name or, perhaps less likely, in the
alias name.  To speed discovery of what the real issue is in such
cases, we'll now search the range table for approximate matches.
If there are one or two such matches that are good enough to think
that they might be what the user intended to type, and better than
all other approximate matches, we'll issue a hint suggesting that
the user might have intended to reference those columns.

Peter Geoghegan and Robert Haas
src/backend/parser/parse_expr.c
src/backend/parser/parse_func.c
src/backend/parser/parse_relation.c
src/backend/utils/adt/levenshtein.c
src/include/parser/parse_relation.h
src/test/regress/expected/alter_table.out
src/test/regress/expected/join.out
src/test/regress/sql/join.sql