On Sun, Aug 8, 2010 at 1:14 PM, Tom Lane <t...@sss.pgh.pa.us> wrote:
> Pavel Stehule <pavel.steh...@gmail.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 rather like \sf, actually; in fact, I think there's a decent
argument to be made that it's more useful than the line-numbering
stuff for \ef.  I don't particularly like the name "\sf", but that's
more because I think backslash commands are a fundamentally unscalable
approach to providing administrative functionality than because I
think there's a better option in this particular case.  It's rather
hard right now to get a function definition out of the database in
easily cut-and-pastable format.  pg_dump won't do it, unless you'd
like to dump the whole schema (I think we should add an option there,
too, actually).  Using \ef is reasonable but if the definition is more
than one page and you actually want to cut-and-paste it rather than
writing it to a file some place, it's not convenient.  (Hopefully you
understand the problem I'm talking about here: cut-and-paste can
scroll past one screen, but the editor doesn't actually write it out
that way; it displays it a page at a time.)  Now, admittedly, this is
only a minor convenience we're talking about: and if this get shot
down I won't cry into my beer, but I do think it's useful.

> 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

That obviously needs to be fixed.

(BTW, if you want to take this one instead of me, that's fine.
Otherwise, I'll get to it this week.)

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise Postgres Company

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to