Re: trailing comment ghost-timing - Mailing list pgsql-hackers

From Andreas Karlsson
Subject Re: trailing comment ghost-timing
Date
Msg-id 52B8F43A.4050504@proxel.se
Whole thread Raw
In response to Re: trailing comment ghost-timing  (David Johnston <polobo@yahoo.com>)
Responses Re: trailing comment ghost-timing
List 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 by date:

Previous
From: Tom Lane
Date:
Subject: Re: Planning time in explain/explain analyze
Next
From: Euler Taveira
Date:
Subject: Re: Planning time in explain/explain analyze