Pq: syntax error with postgres - how to see the query?

Inspect-query does not show query when causing syntax error, neither log level debug

Using Grafana 7.3.1 with Postgresql. I really love the inspect - query function because I can right away post it in pgadmin. However this works only for me if the syntax of the query is correct.
Then I can use it for data problems, e.g. why is the answer empty?

However, if the syntax is not correct, error like: pq: syntax error with postgres at or near the inspect-query function just shows the same error message as a tree.
That means, at the point that it would be most helpful, I do not get the query.

Also augmented log level to DEBUG. There is not even an error shown, just outputs like Successfully connected to Postgres.

Is there any easy way to get more information out of Grafana?
If I do not find it out by simply looking deeper into the raw request (40 lines, 2691 chars), I will either look into postgres or into tracing.

@danielt290947 are you able to post a simple example of the type of query syntax error that caused the message to pop up?

I tried this out with grafana 8.x and saw an error about a non-existent field name return in the UI. The same error also shows in developer tools of the browser if there is an error response from postgres to the query. I’m curious if you’ll still see the problem with latest version of grafana.

Screen Shot 2022-03-09 at 1.57.13 PM