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

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: review: psql: edit function, show function commands patch
Дата
Msg-id 7470.1281544124@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: review: psql: edit function, show function commands patch  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: review: psql: edit function, show function commands patch  (Robert Haas <robertmhaas@gmail.com>)
Re: review: psql: edit function, show function commands patch  (Pavel Stehule <pavel.stehule@gmail.com>)
Список pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
> On Tue, Aug 10, 2010 at 11:58 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> BTW, at least in the usage in that loop, get_functiondef_dollarquote_tag
>> seems grossly overdesigned. �It would be clearer, shorter, and faster if
>> you just had a strncmp test for "AS $function" there.

> As far as I can see, the only purpose of that code is to support the
> desire to have \sf+ display **** rather than a line number for the
> lines that FOLLOW the function body.  But I'm wondering if we should
> just forget about that and let the numbering run continuously from the
> first "AS $function" line to end of file.  That would get rid of a
> bunch of rather grotty code in the \sf patch, also.

Oh?  Considering that in the standard pg_get_functiondef output, the
ending $function$ delimiter is always on the very last line, that sounds
pretty useless.  +1 for just numbering forward from the start line.

BTW, the last I looked, \sf+ was using what I thought to be a quite ugly
and poorly-considered formatting for the line number.  I would suggest
eight blanks for a header line and "%-7d " as the prefix format for a
numbered line.  The reason for making sure the prefix is 8 columns rather
than some other width is to not mess up tab-based formatting of the
function body.  I would also prefer a lot more visual separation between
the line number and the code than "%4d " will offer; and as for the
stars, they're just useless and distracting.
        regards, tom lane


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

Предыдущее
От: "David E. Wheeler"
Дата:
Сообщение: Re: string_to_array with an empty input string
Следующее
От: Tom Lane
Дата:
Сообщение: Re: string_to_array with an empty input string