Re: [HACKERS] trailing comment ghost-timing

2014-04-10 Thread Bruce Momjian
On Mon, Mar 31, 2014 at 02:06:28PM -0400, Bruce Momjian wrote: Where are we on this? It seem odd that psql sends /* */ comments to the server, but not -- comments. Should this be documented or changed? I am confused why changing the behavior would affect the regression test output as --

Re: [HACKERS] trailing comment ghost-timing

2014-03-31 Thread Bruce Momjian
On Sat, Dec 28, 2013 at 08:20:59PM -0500, Tom Lane wrote: Andres Freund and...@2ndquadrant.com writes: On 2013-12-24 12:27:59 -0500, Tom Lane wrote: What I was proposing was that we do include comments in what we send, as long as those comments are embedded in the statement text, not on

Re: [HACKERS] trailing comment ghost-timing

2013-12-28 Thread Tom Lane
Andres Freund and...@2ndquadrant.com writes: On 2013-12-24 12:27:59 -0500, Tom Lane wrote: What I was proposing was that we do include comments in what we send, as long as those comments are embedded in the statement text, not on lines before it. The common way I've seen what I've described

Re: [HACKERS] trailing comment ghost-timing

2013-12-27 Thread Andres Freund
On 2013-12-24 12:27:59 -0500, Tom Lane wrote: Andres Freund and...@2ndquadrant.com writes: This is inconsistent, IMO. I think if we were to fix things so that leading block comments were dropped the same way -- comments are, that would also take care of the behavior complained of in this

Re: [HACKERS] trailing comment ghost-timing

2013-12-24 Thread Fabrízio de Royes Mello
On Tue, Dec 24, 2013 at 5:53 AM, Martijn van Oosterhout klep...@svana.org wrote: On Tue, Dec 24, 2013 at 03:40:58AM +0100, Andreas Karlsson wrote: On 12/24/2013 03:17 AM, David Johnston wrote: It is not sent to the server as a trailing comment. The following file is sent to the server like

Re: [HACKERS] trailing comment ghost-timing

2013-12-24 Thread Peter Eisentraut
On 12/24/13, 5:40 AM, Fabrízio de Royes Mello wrote: (Untested). Isn't this just a case of psql not printing out a timing if the server responds with PGRES_EMPTY_QUERY? Works... look to the attached patch! That looks reasonable. -- Sent via pgsql-hackers mailing list

Re: [HACKERS] trailing comment ghost-timing

2013-12-24 Thread Andres Freund
Hi, On 2013-12-24 02:05:23 +0100, Erik Rijkers wrote: With \timing on, a trailing comment yields a timing. # test.sql select 1; /* select 2 */ $ psql -f test.sql ?column? -- 1 (1 row) Time: 0.651 ms Time: 0.089 ms I assume it is timing something about that

Re: [HACKERS] trailing comment ghost-timing

2013-12-24 Thread Erik Rijkers
On Tue, December 24, 2013 15:19, Andres Freund wrote: Hi, On 2013-12-24 02:05:23 +0100, Erik Rijkers wrote: With \timing on, a trailing comment yields a timing. # test.sql select 1; /* select 2 */ $ psql -f test.sql ?column? -- 1 (1 row) Time: 0.651 ms Time:

Re: [HACKERS] trailing comment ghost-timing

2013-12-24 Thread Tom Lane
Andres Freund and...@2ndquadrant.com writes: Maybe I am thinking to technical here, but why would that be a good idea? After all, the comment will have triggered sending a statement to the server and waiting for the result. The user might want to know about that. I agree; if we triggered a

Re: [HACKERS] trailing comment ghost-timing

2013-12-24 Thread Andres Freund
The real question is whether we shouldn't suppress the whole PQexec. I believe this is very closely related to the question of what we do with a comment preceding the next command. Try this experiment: regression=# /* block comment here */ regression-# select 2+2; regression=# -- dash

Re: [HACKERS] trailing comment ghost-timing

2013-12-24 Thread Tom Lane
Andres Freund and...@2ndquadrant.com writes: This is inconsistent, IMO. I think if we were to fix things so that leading block comments were dropped the same way -- comments are, that would also take care of the behavior complained of in this thread. There's been some previous discussion of

Re: [HACKERS] trailing comment ghost-timing

2013-12-24 Thread Andreas Karlsson
On 12/24/2013 08:53 AM, Martijn van Oosterhout wrote: (Untested). Isn't this just a case of psql not printing out a timing if the server responds with PGRES_EMPTY_QUERY? Yes, it is. Sorry should have made myself more clear (way more clear when I read my messages from yesterday). Then I

[HACKERS] trailing comment ghost-timing

2013-12-23 Thread Erik Rijkers
With \timing on, a trailing comment yields a timing. # test.sql select 1; /* select 2 */ $ psql -f test.sql ?column? -- 1 (1 row) Time: 0.651 ms Time: 0.089 ms I assume it is timing something about that comment (right?). Confusing and annoying, IMHO. Is there any chance

Re: [HACKERS] trailing comment ghost-timing

2013-12-23 Thread Andreas Karlsson
On 12/24/2013 02:05 AM, Erik Rijkers wrote: With \timing on, a trailing comment yields a timing. # test.sql select 1; /* select 2 */ $ psql -f test.sql ?column? -- 1 (1 row) Time: 0.651 ms Time: 0.089 ms I assume it is timing something about that comment (right?).

Re: [HACKERS] trailing comment ghost-timing

2013-12-23 Thread David Johnston
Andreas Karlsson wrote On 12/24/2013 02:05 AM, Erik Rijkers wrote: With \timing on, a trailing comment yields a timing. # test.sql select 1; /* select 2 */ $ psql -f test.sql ?column? -- 1 (1 row) Time: 0.651 ms Time: 0.089 ms I assume it is timing something

Re: [HACKERS] trailing comment ghost-timing

2013-12-23 Thread Andreas Karlsson
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

Re: [HACKERS] trailing comment ghost-timing

2013-12-23 Thread Martijn van Oosterhout
On Tue, Dec 24, 2013 at 03:40:58AM +0100, Andreas Karlsson wrote: On 12/24/2013 03:17 AM, David Johnston wrote: 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(..., /**/);