git.postgresql.org Git - postgresql.git/commit

git projects / postgresql.git / commit
? search:
summary | shortlog | log | commit | commitdiff | tree
(parent: 9c6ad5e) | patch
Give better hints for ambiguous or unreferenceable columns.
2022年11月22日 23:46:31 +0000 (18:46 -0500)
2022年11月22日 23:46:31 +0000 (18:46 -0500)
commit 56d0ed3b756b2e3799a7bbc0ac89bc7657ca2c33
Give better hints for ambiguous or unreferenceable columns.

Examine ParseNamespaceItem flags to detect whether a column name
is unreferenceable for lack of LATERAL, or could be referenced if
a qualified name were used, and give better hints for such cases.
Also, don't phrase the message to imply that there's only one
matching column when there is really more than one.

Many of the regression test output changes are not very interesting,
but just reflect reclassifying the "There is a column ... but it
cannot be referenced from this part of the query" messages as DETAIL
rather than HINT. They are details per our style guide, in the sense
of being factual rather than offering advice; and this change provides
room to offer actual HINTs about what to do.

While here, adjust the fuzzy-name-matching code to be a shade less
impenetrable. It was overloading the meanings of FuzzyAttrMatchState
fields way too much IMO, so splitting them into multiple fields seems
to make it clearer. It's not like we need to shave bytes in that
struct.

Per discussion of bug #17233 from Alexander Korolev.

Discussion: https://postgr.es/m/17233-afb9d806aaa64b17@postgresql.org
src/backend/parser/parse_relation.c diff | blob | blame | history
src/test/regress/expected/insert_conflict.out diff | blob | blame | history
src/test/regress/expected/join.out diff | blob | blame | history
src/test/regress/expected/merge.out diff | blob | blame | history
src/test/regress/expected/rules.out diff | blob | blame | history
src/test/regress/expected/union.out diff | blob | blame | history
src/test/regress/sql/join.sql diff | blob | blame | history
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /