line numbers in error messages are off wrt debuggers

From: Andres Freund <andres(at)anarazel(dot)de>
To: pgsql-hackers(at)postgresql(dot)org
Subject: line numbers in error messages are off wrt debuggers
Date: 2018-06-20 16:04:34
Message-ID: 20180620160434.vznwmgllqdtt24jx@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

I'm fairly frequently annoyed that when I see an error message in the
log, I can't just generally set a breakpoint on the included line
number. That's because the line number in the error message is from the
*end* of the message:

2018-06-20 09:02:39.226 PDT [21145][3/2] LOG: 00000: statement: SELECT 1;
2018-06-20 09:02:39.226 PDT [21145][3/2] LOCATION: exec_simple_query, postgres.c:952

corresponds to

ereport(LOG,
(errmsg("statement: %s", query_string),
errhidestmt(true),
errdetail_execute(parsetree_list)));

with 952 being the line with the semicolon.

Are others bothered by this?

If so, does anybody have a handle how we could get a more useful line
number out of the preprocessor?

Greetings,

Andres Freund

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2018-06-20 16:04:51 Re: PATCH: backtraces for error messages
Previous Message Tom Lane 2018-06-20 15:59:57 Re: ERROR: ORDER/GROUP BY expression not found in targetlist