mirror of
https://github.com/postgres/postgres.git
synced 2025-07-28 23:42:10 +03:00
Improve parser so that we can show an error cursor position for errors
during parse analysis, not only errors detected in the flex/bison stages. This is per my earlier proposal. This commit includes all the basic infrastructure, but locations are only tracked and reported for errors involving column references, function calls, and operators. More could be done later but this seems like a good set to start with. I've also moved the ReportSyntaxErrorPosition logic out of psql and into libpq, which should make it available to more people --- even within psql this is an improvement because warnings weren't handled by ReportSyntaxErrorPosition.
This commit is contained in:
@ -881,7 +881,9 @@ SELECT earth_box(ll_to_earth(90,180),
|
||||
--
|
||||
SELECT is_point(ll_to_earth(0,0));
|
||||
ERROR: function is_point(earth) does not exist
|
||||
HINT: No function matches the given name and argument types. You may need to add explicit typecasts.
|
||||
LINE 1: SELECT is_point(ll_to_earth(0,0));
|
||||
^
|
||||
HINT: No function matches the given name and argument types. You may need to add explicit type casts.
|
||||
SELECT cube_dim(ll_to_earth(0,0)) <= 3;
|
||||
?column?
|
||||
----------
|
||||
@ -897,7 +899,9 @@ SELECT abs(cube_distance(ll_to_earth(0,0), '(0)'::cube) / earth() - 1) <
|
||||
|
||||
SELECT is_point(ll_to_earth(30,60));
|
||||
ERROR: function is_point(earth) does not exist
|
||||
HINT: No function matches the given name and argument types. You may need to add explicit typecasts.
|
||||
LINE 1: SELECT is_point(ll_to_earth(30,60));
|
||||
^
|
||||
HINT: No function matches the given name and argument types. You may need to add explicit type casts.
|
||||
SELECT cube_dim(ll_to_earth(30,60)) <= 3;
|
||||
?column?
|
||||
----------
|
||||
@ -913,7 +917,9 @@ SELECT abs(cube_distance(ll_to_earth(30,60), '(0)'::cube) / earth() - 1) <
|
||||
|
||||
SELECT is_point(ll_to_earth(60,90));
|
||||
ERROR: function is_point(earth) does not exist
|
||||
HINT: No function matches the given name and argument types. You may need to add explicit typecasts.
|
||||
LINE 1: SELECT is_point(ll_to_earth(60,90));
|
||||
^
|
||||
HINT: No function matches the given name and argument types. You may need to add explicit type casts.
|
||||
SELECT cube_dim(ll_to_earth(60,90)) <= 3;
|
||||
?column?
|
||||
----------
|
||||
@ -929,7 +935,9 @@ SELECT abs(cube_distance(ll_to_earth(60,90), '(0)'::cube) / earth() - 1) <
|
||||
|
||||
SELECT is_point(ll_to_earth(-30,-90));
|
||||
ERROR: function is_point(earth) does not exist
|
||||
HINT: No function matches the given name and argument types. You may need to add explicit typecasts.
|
||||
LINE 1: SELECT is_point(ll_to_earth(-30,-90));
|
||||
^
|
||||
HINT: No function matches the given name and argument types. You may need to add explicit type casts.
|
||||
SELECT cube_dim(ll_to_earth(-30,-90)) <= 3;
|
||||
?column?
|
||||
----------
|
||||
|
Reference in New Issue
Block a user