Re: add line number as prompt option to psql - Mailing list pgsql-hackers

From Jeevan Chalke
Subject Re: add line number as prompt option to psql
Date
Msg-id CAM2+6=UXN9wRFSFnZpov7LZzqzssZDoG=U=wLXx1Qu0hH+uEuQ@mail.gmail.com
Whole thread Raw
In response to Re: add line number as prompt option to psql  (Sawada Masahiko <sawada.mshk@gmail.com>)
Responses Re: add line number as prompt option to psql  (Alvaro Herrera <alvherre@2ndquadrant.com>)
List pgsql-hackers
Hi,


On Fri, Jul 11, 2014 at 3:13 PM, Sawada Masahiko <sawada.mshk@gmail.com> wrote:
>
>

To my understating cleanly, you means that line number is not changed
when newline has reached to INT_MAX, is incorrect?

As per my thinking yes.
 
And the line number should be switched to 1 when line number has
reached to INT_MAX?

Yes, when it goes beyond INT_MAX, wrap around to 1.

BTW, I wonder, can't we simply use unsigned int instead?

Also, what is the behaviour on LINE n, in error message in case of such wrap-around?
 

>
> Or much better, simply get rid of newline, and use cur_line itself, will
> this work well for you?

this is better.  I will change code to this.
Thanks.
I will fix it.


Meanwhile I have tried this. Attached patch to have your suggestion on that.

Thanks

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

Attachment

pgsql-hackers by date:

Previous
From: Magnus Hagander
Date:
Subject: Re: Missing autocomplete for CREATE DATABASE
Next
From: David Rowley
Date:
Subject: Re: Allowing NOT IN to use ANTI joins