Re: question about sql comments in postgresql server logs

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alan Stange <stange(at)rentec(dot)com>
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: question about sql comments in postgresql server logs
Date: 2021-08-06 19:14:52
Message-ID: 2501234.1628277292@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Alan Stange <stange(at)rentec(dot)com> writes:
> 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.
> If we instead sent
>     select foo from /* a comment with some metadata */ bar
> then the comment was included in the server log file as we had hoped.

If memory serves, this is a psql behavior not the server's.
I counsel using /* ... */ comments for the purpose.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Alan Stange 2021-08-06 19:21:57 Re: question about sql comments in postgresql server logs
Previous Message Tim Clarke 2021-08-06 19:10:45 Re: question about sql comments in postgresql server logs