Re: psql shows line number
От | Sawada Masahiko |
---|---|
Тема | Re: psql shows line number |
Дата | |
Msg-id | CAD21AoCYFiepJh0iUUddW8PF6OMUm4be54vup7dLJecDMkqyEQ@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: psql shows line number (Pavel Stehule <pavel.stehule@gmail.com>) |
Список | pgsql-hackers |
<p dir="ltr"><br /> 2013/11/26 22:24 "Pavel Stehule" <<a href="mailto:pavel.stehule@gmail.com">pavel.stehule@gmail.com</a>>:<br/> ><br /> ><br /> ><br /> ><br /> >2013/11/26 Sawada Masahiko <<a href="mailto:sawada.mshk@gmail.com">sawada.mshk@gmail.com</a>><br /> >><br/> >> On Tue, Nov 26, 2013 at 9:23 PM, Marko Tiikkaja <<a href="mailto:marko@joh.to">marko@joh.to</a>>wrote:<br /> >> > On 11/26/13 1:05 PM, Sawada Masahiko wrote:<br/> >> >><br /> >> >> When I execute query which contains error, the server returns error<br/> >> >> with line number.<br /> >> >><br /> >> >> ERROR: relation "hoge" doesnot exist<br /> >> >> LINE 35: hoge;<br /> >> >><br /> >> >> But when query is long,I was not sure the location where I wrote wrong<br /> >> >> SQL.<br /> >> >> Does the psql haveoption which shows line number?<br /> >> >> If no, I'm thinking to implement this feature. Thought?<br />>> >> I think it is useful if the psql shows line number like follows<br /> >> ><br /> >> ><br/> >> > If the query is long, you'll likely want to \e to edit it anyway, no? I'm<br /> >> >sure any text editor worth $EDITOR will know how to jump to a specific line.<br /> >> Thanks!<br /> >> ¥eis also good. I didn't know this.<br /> >> I thought that showing line number on psql is light and simple.<br />>> So I thought that psql can also have such feature as standard function.<br /> >><br /> >><br /> >>> idea is interesting, but a proposed format is not clean (and little bit ugly, and<br /> >> > can bebarrier for copy from terminal to editor. Now, simple replace can be used for cleaning.<br /> >> Thanks!<br /> >>Yes, it is little ugly.<br /> >> I was also thinking to fill space of line number with whitespace. likes:<br/> >><br /> >> [ 1]postgres=# SELECT<br /> >> [ 2]postgres=# hoge.col1<br /> >> :<br />>> [ 9]postgres=# FROM<br /> >> [ 10]postgres=# hoge;<br /> >><br /> >> But I think that it isalso something just isn't right.<br /> >><br /> >> > maybe we can introduce a command, that will print SQLfrom history with line numbers - like \sf+<br /> >> I think that ¥sf+ shows definition of function. How should Iuse this?<br /> ><br /> ><br /> > yes, but we can define new statement like \sq+ (Show Query)<br /> ><br />I understood.<br /> it looks good to me.<p dir="ltr">it is similer to searching history(i.g., just push up-arrow-key)?<pdir="ltr">Regards,<p dir="ltr">Masahiko Sawada
В списке pgsql-hackers по дате отправления: