Re: trailing comment ghost-timing

Поиск
Список
Период
Сортировка
От Andreas Karlsson
Тема Re: trailing comment ghost-timing
Дата
Msg-id 52B8F43A.4050504@proxel.se
обсуждение исходный текст
Ответ на Re: trailing comment ghost-timing  (David Johnston <polobo@yahoo.com>)
Ответы Re: trailing comment ghost-timing  (Martijn van Oosterhout <kleptog@svana.org>)
Список pgsql-hackers
On 12/24/2013 03:17 AM, David Johnston wrote:
> I need to be convinced that the server should not just silently ignore
> trailing comments.  I'd consider an exception if the only text sent is a
> comment ( in such a case we should throw an error ) but if valid commands
> are sent and there is just some comment text at the end it should be ignored
> the same as if the comments were embedded in the middle of the query text.
>
> I've encountered other clients that output phantom results in this situation
> and solving it at the server seems worthwhile so client applications do not
> have to care.
>
> In the example case, I think, putting the comment before the command results
> in only one timing.  This inconsistency is a symptom of this situation being
> handled incorrectly.

It is not sent to the server as a trailing comment. The following file 
is sent to the server like this.

File:
/**/;
/**/

Commands:
PQexec(..., "/**/;");
PQexec(..., "/**/");

If this has to be fixed it should be in the client. I think people would 
complain if we broke the API by starting to throw an exception on PQexec 
with a string containing no actual query.

-- 
Andreas Karlsson



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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Planning time in explain/explain analyze
Следующее
От: Euler Taveira
Дата:
Сообщение: Re: Planning time in explain/explain analyze