2010/8/9 Robert Haas <robertmhaas@gmail.com>:
> On Sun, Aug 8, 2010 at 11:38 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> Um, but \sf *doesn't* give you anything that's usefully copy and
>> pasteable.
>
> Works for me.
>
> \sf ts_debug(regconfig, text)
>
>> And if that were the goal, why doesn't it have an option to
>> write to a file?
>
> Well, you cut-and-paste from a terminal window, not a file, so that's
> a slightly different problem, although perhaps also a good one to
> solve. But I'd rather see us solve that problem via some new pg_dump
> functionality.
>
> Hmm... or perhaps \sf should respect \o. I notice that \d does.
it's not a bad idea.
updated patch attached
>
>> But it's really the line numbers shoved in front that I'm on about here.
>> I can't see *any* use for that behavior except to figure out what part of
>> your function an error message with line number is referring to; and as
>> I said upthread, there are better ways to be attacking that problem.
>> If you've got a thousand-line function (yes, they're out there) do you
>> really want to be scrolling through \sf output to find out what line 714
>> is?
>
> Well, as Pavel points out, I guess you could use the "line number"
> argument to \sf to start at around the place you're interested in,
> athough I suspect that I would probably choose to use \ef in that
> case. I suspect \sf is in general most useful with somewhat shorter
> functions (I'd copy and paste a 100 line function, perhaps, but for a
> 1000 line function I'd probably try to get the definition into a file
> and scp it or whatever).
>
> --
> Robert Haas
> EnterpriseDB: http://www.enterprisedb.com
> The Enterprise Postgres Company
>