line numbers in error messages are off wrt debuggers - Mailing list pgsql-hackers

From Andres Freund
Subject line numbers in error messages are off wrt debuggers
Date
Msg-id 20180620160434.vznwmgllqdtt24jx@alap3.anarazel.de
Whole thread Raw
Responses Re: line numbers in error messages are off wrt debuggers
List 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


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: ERROR: ORDER/GROUP BY expression not found in targetlist
Next
From: Tom Lane
Date:
Subject: Re: PATCH: backtraces for error messages