Re: proposal: more practical view on function's source code

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Craig Ringer <craig(at)postnewspapers(dot)com(dot)au>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: proposal: more practical view on function's source code
Date: 2010-03-21 16:09:40
Message-ID: 162867791003210909h127b3e3fwcfc835497a5a2a37@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

2010/3/21 Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>:
> Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> writes:
>> I understanding. But this functionality is implemented yet. My
>> motivation is to design some tool for more easy searching n. row in
>> source code (for interpretation error messages) and possibility to see
>> this row in some context.
>
> Why is this a good way to attack that?  If you think the context already
> provided in error messages isn't good enough, seems like the thing to do
> is fix the error messages.  Nobody is going to want to dump out a
> multi-hundred-line function like this in order to identify which
> statement is being fingered by an error.

I hope so it is good way. Sure, it is personal - somebody looking on
error message and knows all - not me, and I hope so I am not the total
lost person :). I dislike solution like gdb with showing n lines
before and n lines after. And we cannot to use some external tools for
line numbering, because line numbering in our PL languages is very
specific (using line number in external editor can be confusing - I am
old dog (not for me)).

Not only for me is very difficult to identify row number from error message.

I am sure, so this way is useless for multi-hundred-line function, but
I hope so nobody write this functions (only one times I wrote very
long procedure, because I could not to use a global variables).
Optimum is about 60 lines still - and from my experience max is about
200 lines and don't forget - there is a pager.

Regards
Pavel Stehule

>
>                        regards, tom lane
>

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2010-03-21 17:07:02 Re: xmlconcat (was 9.0 release notes done)
Previous Message Tom Lane 2010-03-21 15:42:46 Re: proposal: more practical view on function's source code