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

Dimitri Fontaine <dfontaine@hi-media.com>

From: Dimitri Fontaine <dfontaine@hi-media.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Pavel Stehule <pavel.stehule@gmail.com>, Craig Ringer <craig@postnewspapers.com.au>, PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2010-03-21T17:51:52Z
Lists: pgsql-hackers
Tom Lane <tgl@sss.pgh.pa.us> writes:
> 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.

Well that's true in that I've often counted lines myself for short
enough procedures, and as soon as they too long I just add lots of RAISE
NOTICE and build up a test-case etc.

I'm not sure what better tool than what Pavel is proposing we already
have, though. Sure, I should go and write a complete pgsql emacs mode
with a linum-mode like feature counting lines the way PG does it, …

But a simple \dfs for seeing the only the source, maybe with \dfs+ for
seeing the line numbers too, would be a nice addition to psql in my
view.

Regards,
-- 
dim