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

Поиск
Список
Период
Сортировка
От Robert Haas
Тема Re: review: psql: edit function, show function commands patch
Дата
Msg-id AANLkTiny4JEQmTBJv2n5XHtdo928W5aoiwJ+bzG_TfOm@mail.gmail.com
обсуждение исходный текст
Ответ на Re: review: psql: edit function, show function commands patch  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: review: psql: edit function, show function commands patch  (Pavel Stehule <pavel.stehule@gmail.com>)
Список pgsql-hackers
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.

> 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


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Pavel Stehule
Дата:
Сообщение: is syntax columname(tablename) necessary still?
Следующее
От: Pavel Stehule
Дата:
Сообщение: Re: review: psql: edit function, show function commands patch