Re: client side syntax error localisation for psql (v1) - Mailing list pgsql-hackers

From Fabien COELHO
Subject Re: client side syntax error localisation for psql (v1)
Date
Msg-id Pine.LNX.4.58.0403111821140.12205@sablons.cri.ensmp.fr
Whole thread Raw
In response to Re: client side syntax error localisation for psql (v1)  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: client side syntax error localisation for psql (v1)  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: client side syntax error localisation for psql (v1)  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-hackers
Dear Tom,

> >> The "on line N" bit seems just noise to me.
> > It depends.
>
> I can see that it would be useful in a very large query.  Perhaps
> include it only when the query has more than N lines, for some N
> like three to five or so?

Yes, I can do that.

> Another possibility is to keep the cursor as just "^", and bury the
> line info in the query extract.  For instance:

Well, I want to preserve space for the query extract, that's where the
context information is! If I put more information there, I'll have to
reduce the extract length.

Moreover the cursor line information content is small, so it seems better
to put the line information there.

> (So "LINE n" would never say "LINE 1", only larger line numbers.)

I agree that LINE 1 looks pretty useless, especially if there is only
one line;-)

> I think this wouldn't be terribly complex to implement, and it would
> make things look fairly nice for both short and long queries.

There is also an alignment issue here, as depending on the number of
figures, the cursor line would have to be fixed accordingly.

> One last point: it seems a bit odd to use QUERY: as the prefix for both
> the query extract and the cursor line.  I don't have a suggestion what
> to use instead, offhand.

I agree, but couldn't think of a better choice either.

There is also a localisation issue here, as the translation of both lines
must match so that the alignment is kept. I thought that if it is the very
same word, the translation should be the same.

Thanks for your comments and ideas, I'll submit a v3 on (my) tomorrow.

Have a nice day,

-- 
Fabien Coelho - coelho@cri.ensmp.fr


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: client side syntax error localisation for psql (v1)
Next
From: Fabien COELHO
Date:
Subject: Re: client side syntax error localisation for psql (v1)