Re: review: psql: edit function, show function commands patch

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Jan Urbański <wulczer(at)wulczer(dot)org>, Postgres - Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: review: psql: edit function, show function commands patch
Date: 2010-08-08 18:01:48
Message-ID: AANLkTi=fzjfXHR1f0ktSk_8QR=kB3UAu1vXyWgMcbMa-@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

2010/8/8 Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>:
> Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> writes:
>> updated patch attached
>
> What exactly is the point of the \sf command?  It seems like quite a lot
> of added code for a feature that nobody has requested, and whose
> definition is about as ad-hoc as could be.  Personally I'd much sooner
> use \ef for looking at a function definition.  I think if \sf had been
> submitted as a separate patch, rather than being snuck in with a feature
> people do want, it wouldn't be accepted.

I disagree. Now, you cannot to show a detail of function in well
readable form. Personally I prefer \sf+ form. Because I can see line
numbers, but \sf form is important for some copy paste operations. I
don't think, so \ef can replace \sf. It is based on my personal
experience. When I have to do some fast fix or fast decision I need to
see a source code of some functions (but I am in customer's
environment). Starting a external editor is slow and usually you can
not there to start your preferable editor.

If I return back then my first idea was to modify current \df command
to some practical form. Later in discussion was decided so new command
will be better.

>
> The current patch doesn't even compile warning-free :-(
>
> command.c: In function `exec_command':
> command.c:559: warning: `lineno' might be used uninitialized in this function
> command.c: In function `editFile':
> command.c:1729: warning: `editor_lineno_switch' might be used uninitialized in this function

there is some strange - it didn't find it in my environment. But I
recheck it tomorrow morning.

Regards

Pavel Stehule

>
>                        regards, tom lane
>

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2010-08-08 18:05:53 Re: Initial review of xslt with no limits patch
Previous Message Tom Lane 2010-08-08 17:45:20 Re: review: xml_is_well_formed