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

Поиск
Список
Период
Сортировка
От Fabien COELHO
Тема Re: client side syntax error localisation for psql (v1)
Дата
Msg-id Pine.LNX.4.58.0403111726340.12205@sablons.cri.ensmp.fr
обсуждение исходный текст
Ответ на Re: client side syntax error localisation for psql (v1)  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Dear Tom,

> > Please find attached my first attempt at providing a localisation
> > information on the client side for syntax errors in "psql".
>
> "Localisation" tends to mean something quite different around here. I'd
> suggest renaming the function to something like ReportSyntaxErrorPosition.

Ok. "Localisation" was the good french word;-)

> Would it read better to add "..." at the front and/or back of the query
> extract, when you have actually truncated text at that end?

I thought about it as well, but did not implement it.
I agree that it would look better. I can have a go.

> The "on line N" bit seems just noise to me.

It depends.

If you're in the middle of a sql-script as I often do, giving the line
within the statement isn't bad. Say:

SELECT o.titre
FROM collections AS col, ouvrages AS o, a_ecrit AS e, auteurs AS a
WHERE o.id=e.oeuvre AND e.auteur=a.id AND o.collection=col.idAND col.nom LIKE '%Spirou%' AND a.nom<>'Franquin'
EXCEPT
SELECT o.titre
FROM collections AS col, ouvrages AS o, a_ecrit AS e, auteurs AS a
WHERE o.id=e.oeuvre AND e.auteur=a.id AND o.collection=col.idAND col.nom LIKE '%Spirou%' AND a.nom='Franquin';

All lines look the same... So I would prefer to keep it.

Well, if it is the only issue against the adoption of the patch, I will do
without the line number.

I'll submit a new patch in a moment.

Thanks for your comments,

-- 
Fabien.


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Fabien COELHO
Дата:
Сообщение: Re: client side syntax error localisation for psql (v1)
Следующее
От: Greg Stark
Дата:
Сообщение: Re: [pgsql-hackers-win32] fsync with sync, and Win32 unlink