Re: Include 3 previous tokens in syntax error message

2020-12-27 Thread Tom Lane
Andrus writes: > Postgres returns unreadable syntax error messageges like > Syntax error at or near ')' > How to fix this so that 3 last tokens are returned in message like > Syntax error at or near ' i > )' Our take on this is that it's the client code's responsibility to present a useful error

Include 3 previous tokens in syntax error message

2020-12-27 Thread Andrus
Hi! Postgres returns unreadable syntax error messageges like Syntax error at or near ')' If there are many ) characters in query, it is not possible to find the palce where error occurs. STATEMENT_POSITION is difficult to use since drivers perform parameter replacements which makes this dif