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

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, 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-22 00:40:38
Message-ID: 603c8f071003211740m78ee446ekbef9c812b7602db1@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sun, Mar 21, 2010 at 4:35 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Robert Haas <robertmhaas(at)gmail(dot)com> writes:
>> I'm not sure that Pavel's idea is the right way to attack the problem,
>> but I don't agree with this either.  Line numbers are really the only
>> feasible way of identifying a position in a large function.  I usually
>> bring up the function source code in vi and then use j with a repeat
>> count to find the offending line.  It's not uncommon for me to have
>> various places in the function that look somewhat similar, so
>> expecting me to find the right place other than by the line number
>> would not work very well for me.
>
> I'm certainly not proposing removing the line number from error
> messages.  I'm just saying that I see no value in the proposed psql \df
> change for this purpose.
>
> The direction that we ought to be pushing in, I think, is the same as
> the vision for syntax error handling: enable pgAdmin and similar tools
> to pop up the function text with a cursor placed at (more or less) the
> right place.  It's interesting to think about how that might be extended
> to lower-tech solutions like \ef.  I could see telling people to type
>        \ef function-name line-number
> with suitable magic to get the editor to place the cursor at that line.
> I suspect this wouldn't be too hard to do with emacs --- what do you
> think about vi?

Well, in vi you can just do "vi +linenum filename".

...Robert

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2010-03-22 00:41:23 Re: 9.0 release notes done
Previous Message Bruce Momjian 2010-03-21 22:14:17 Re: 9.0 release notes done