Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mC5J2-0003Rb-G9 for pgsql-general@arkaria.postgresql.org; Fri, 06 Aug 2021 19:14:56 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mC5J1-0006hb-FI for pgsql-general@arkaria.postgresql.org; Fri, 06 Aug 2021 19:14:55 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mC5J1-0006h6-6Y for pgsql-general@lists.postgresql.org; Fri, 06 Aug 2021 19:14:55 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mC5Iy-0007PT-Tn for pgsql-general@lists.postgresql.org; Fri, 06 Aug 2021 19:14:54 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 176JEqWB2501235; Fri, 6 Aug 2021 15:14:52 -0400 From: Tom Lane To: Alan Stange cc: pgsql-general@lists.postgresql.org Subject: Re: question about sql comments in postgresql server logs In-reply-to: References: Comments: In-reply-to Alan Stange message dated "Fri, 06 Aug 2021 15:08:34 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <2501233.1628277292.1@sss.pgh.pa.us> Content-Transfer-Encoding: 8bit Date: Fri, 06 Aug 2021 15:14:52 -0400 Message-ID: <2501234.1628277292@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Alan Stange 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