Re: question about sql comments - Mailing list pgsql-jdbc

From Thomas Kellerer
Subject Re: question about sql comments
Date
Msg-id 8ee165dd-0dd5-d85d-cc88-12210a81f38e@gmx.net
Whole thread Raw
In response to question about sql comments  (Alan Stange <stange@rentec.com>)
List pgsql-jdbc
Alan Stange schrieb am 06.08.2021 um 22:31:
> Hello all,
>
> In order to track down some bugs, we thought it would be useful to
> append some comments to the sql being sent to postgresql like this:
>      select foo from bar;  -- a comment with some metadata
> however, the postgresql server was not including the appended comment in
> the log file.

The ; ends the statement, so the comment you sent actually belongs to
the _next_ statement.

Did you try adding the single line comment before the statement?

     -- a comment
     select foo from bar;


Thomas



pgsql-jdbc by date:

Previous
From: Alan Stange
Date:
Subject: question about sql comments
Next
From: Dave Cramer
Date:
Subject: Re: Are these bugs?