Re: add line number as prompt option to psql
От | Sawada Masahiko |
---|---|
Тема | Re: add line number as prompt option to psql |
Дата | |
Msg-id | CAD21AoBt6jb3pXAX1_Cf33FPHwX+a__-OpGndbTcb7QSKRLybQ@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: add line number as prompt option to psql (Jeevan Chalke <jeevan.chalke@enterprisedb.com>) |
Ответы |
Re: add line number as prompt option to psql
|
Список | pgsql-hackers |
On Mon, Jul 7, 2014 at 8:33 PM, Jeevan Chalke <jeevan.chalke@enterprisedb.com> wrote: > Hi, > > Found two (A and B) issues with latest patch: > > A: > -- Set prompts > postgres=# \set PROMPT1 '%/[%l]%R%# ' > postgres[1]=# \set PROMPT2 '%/[%l]%R%# ' > > postgres[1]=# > postgres[1]=# select > postgres[2]-# * > postgres[3]-# from > postgres[4]-# abc; > ERROR: relation "abc" does not exist > LINE 4: abc; > ^ > > Now I used \e to edit the source. Deleted last line i.e. "abc;" and > returned to prompt, landed at line 4, typed "abc;" > > postgres[1]=# \e > postgres[4]-# abc; > ERROR: relation "abc" does not exist > LINE 5: abc; > ^ > > In above steps, error message says "LINE 5", where as on prompt "abc" is at > line 4. > > > postgres[1]=# select > * > from > abc; > ERROR: relation "abc" does not exist > LINE 4: abc; > ^ > > Here I again see error at line 4. Something fishy. Please investigate. > Looks like bug in LINE numbering in error message, not sure though. > But with prompt line number feature, it should be sync to each other. > > > B: > However, I see that you have removed the code changes related to INT_MAX. > Why? > I have set cur_line to INT_MAX - 2 and then observed that after 2 lines I > start getting negative numbers. > Thank you for reviewing the patch. I have revised the patch, and attached. > A: > But with prompt line number feature, it should be sync to each other. This patch can handle this case. > B: > However, I see that you have removed the code changes related to INT_MAX. > Why? I had mistake to remove them. I added them to latest patch. Regards, ------- Sawada Masahiko
Вложения
В списке pgsql-hackers по дате отправления: