Re: question about sql comments

From: Thomas Kellerer <shammat(at)gmx(dot)net>
To: pgsql-jdbc(at)lists(dot)postgresql(dot)org
Subject: Re: question about sql comments
Date: 2021-08-07 05:34:20
Message-ID: 8ee165dd-0dd5-d85d-cc88-12210a81f38e@gmx.net
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Dave Cramer 2021-08-08 10:52:47 Re: Are these bugs?
Previous Message Alan Stange 2021-08-06 20:31:22 question about sql comments