Re: add line number as prompt option to psql

Поиск
Список
Период
Сортировка
От Jeevan Chalke
Тема Re: add line number as prompt option to psql
Дата
Msg-id CAM2+6=UWXoy4-Laowy8mvt3sk4fjGxNkM0Yp4Z-RgtkdgnP_Kw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: add line number as prompt option to psql  (Sawada Masahiko <sawada.mshk@gmail.com>)
Ответы Re: add line number as prompt option to psql  (Sawada Masahiko <sawada.mshk@gmail.com>)
Re: add line number as prompt option to psql  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Список pgsql-hackers
Hi,

I have reviewed this:

I have initialize cur_lineno to UINTMAX - 2. And then observed following
behaviour to check wrap-around.

postgres=# \set PROMPT1 '%/[%l]%R%# '
postgres[18446744073709551613]=# \set PROMPT2 '%/[%l]%R%# '
postgres[18446744073709551613]=# select
postgres[18446744073709551614]-# a
postgres[18446744073709551615]-# ,
postgres[0]-# b
postgres[1]-# from
postgres[2]-# dual;


It is wrapping to 0, where as line number always start with 1. Any issues?

I would like to ignore this as UINTMAX lines are too much for a input
buffer to hold. It is almost NIL chances to hit this.


However, I think you need to use UINT64_FORMAT while printing uint64
number. Currently it is %u which wrap-around at UINT_MAX.
See how pset.lineno is displayed.

Apart from this, I didn't see any issues in my testing.

Patch applies cleanly. make/make install/initdb/make check all are well.

Thanks

--
Jeevan B Chalke
Principal Software Engineer, Product Development
EnterpriseDB Corporation
The Enterprise PostgreSQL Company

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

Предыдущее
От: Etsuro Fujita
Дата:
Сообщение: Re: August commitfest
Следующее
От: Heikki Linnakangas
Дата:
Сообщение: Re: tweaking NTUP_PER_BUCKET