Re: client side syntax error localisation for psql (v1)

From: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL Developers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: client side syntax error localisation for psql (v1)
Date: 2004-03-11 17:33:43
Message-ID: Pine.LNX.4.58.0403111821140.12205@sablons.cri.ensmp.fr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)cri(dot)ensmp(dot)fr

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Greg Stark 2004-03-11 17:51:09 Re: [pgsql-hackers-win32] fsync with sync, and Win32 unlink
Previous Message Tom Lane 2004-03-11 17:18:38 Re: client side syntax error localisation for psql (v1)