4 ms·
> The one thing I wish they would do, though, is improve the error messages when a query fails. Yea, we definitely need to do better there. But it's harder tha
by anarazel 7y ago
> The one thing I wish they would do, though, is improve the error messages when a query fails.
Yea, we definitely need to do better there. But it's harder than one might think initially :(. My suspicion is that we (the PG developers) will have to write our own parser generator at some point... We don't really want to go to a manually written recursive descent parser, to a large part because the parser generator ensuring that the grammar doesn't have ambiguities is very helpful.
> At the very least, if I know which position in the text is the beginning of an error, I can fix it.
For many syntax errors and the like we actually do output positions. E.g.
postgres[1429782][1]=# SELECT * FROM FROM blarg;
ERROR: 42601: syntax error at or near "FROM"
LINE 1: SELECT * FROM FROM blarg;
^
(with a mono font the ^ should line up with the second FROM)
If you have a more concrete example of unhelpful errors that particularly bug you, it'd be helpful. In some cases it could be an easy change.