jakob / Postico

Public issue tracking for Postico
https://eggerapps.at/postico/
476 stars 9 forks source link

Make the line numbers in errors start from the beginning of file #872

Open n-splv opened 7 months ago

n-splv commented 7 months ago

When exploring the data, it's not uncommon to have multiple rather complex queries written in a single file. In the UI the line numbers start from the beginning of a file, which is conventional.

However, if a query contains errors, the traceback reports its line number starting from the query itself:

/*
Other queries here
*/
select this;
ERROR:  column "this" does not exist
LINE 1: select this;
               ^

So when your error is at line 42, you have to go check which line does your query begin at and do the math in your head, which is not too hard, but definitely not convenient either :)