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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
Cc: PostgreSQL Developers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: client side syntax error localisation for psql (v1)
Date: 2004-03-12 14:38:23
Message-ID: 8948.1079102303@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Fabien COELHO <coelho(at)cri(dot)ensmp(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Dave Page 2004-03-12 14:42:47 Re: The Name Game: postgresql.net vs. pgfoundry.org
Previous Message Fernando Nasser 2004-03-12 14:24:28 Re: Log rotation