Include 3 previous tokens in syntax error message - Mailing list pgsql-general

From Andrus
Subject Include 3 previous tokens in syntax error message
Date
Msg-id ed636acc-f4c4-7b50-3d59-fc727068e4c7@hot.ee
Whole thread Raw
Responses Re: Include 3 previous tokens in syntax error message  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general

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 different from source position.

How to fix this so that 3 last tokens are returned in message like

Syntax error at or near ' i > )' Andrus.

pgsql-general by date:

Previous
From: Ahmet Demir
Date:
Subject: Re: alter system command
Next
From: Tom Lane
Date:
Subject: Re: Include 3 previous tokens in syntax error message