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

From Tom Lane
Subject Re: client side syntax error localisation for psql (v1)
Date
Msg-id 8948.1079102303@sss.pgh.pa.us
Whole thread Raw
In response to Re: client side syntax error localisation for psql (v1)  (Fabien COELHO <coelho@cri.ensmp.fr>)
List pgsql-hackers
Fabien COELHO <coelho@cri.ensmp.fr> writes:
> As a compromise, I can suggest the following:

> LINE 4: WHERE id=123 AND name LIKE 'calvin' GROP BY name...
>                                             ^

That works for me.  I don't mind it saying LINE 1: in the one-line case.

>> It's not going to add more than about one strlen() call to what you need
>> to do.

> I cannot strlen an integer value;-) I have to convert to a string, or
> deal directly with the line number.

Well, what I'm imagining is that you sprintf("LINE %d") and then strlen
that in the process of constructing the first line, and later add that
length to the offset you need in the second line.

Tatsuo's complaints about characters that span more than one position
are a much nastier problem, in any case :-(.  Can we cope?
        regards, tom lane


pgsql-hackers by date:

Previous
From: Fernando Nasser
Date:
Subject: Re: Log rotation
Next
From: "Dave Page"
Date:
Subject: Re: The Name Game: postgresql.net vs. pgfoundry.org