RE: libpq debug log

From: "tsunakawa(dot)takay(at)fujitsu(dot)com" <tsunakawa(dot)takay(at)fujitsu(dot)com>
To: "iwata(dot)aya(at)fujitsu(dot)com" <iwata(dot)aya(at)fujitsu(dot)com>, "k(dot)jamison(at)fujitsu(dot)com" <k(dot)jamison(at)fujitsu(dot)com>, 'Alvaro Herrera' <alvherre(at)alvh(dot)no-ip(dot)org>
Cc: "'pgsql-hackers(at)lists(dot)postgresql(dot)org'" <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: RE: libpq debug log
Date: 2021-02-09 02:26:25
Message-ID: TYAPR01MB299039FF61225CE7F886441DFE8E9@TYAPR01MB2990.jpnprd01.prod.outlook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

From: Iwata, Aya/岩田 彩 <iwata(dot)aya(at)fujitsu(dot)com>
> I update the patch.
> I modified code according to review comments of Tsunakawa san and
> Horiguchi san.

I confirmed that all the previous feedback was reflected. Here are some minor comments:

(45)
void PQtrace(PGconn *conn, FILE *stream);
</synopsis>
</para>

+ <para>
+ Calls <function>PQtraceEx</function> to output with or without a timestamp
+ using <literal>flags</literal>.
+ </para>
+
+ <para>
+ <literal>flags</literal> contains flag bits describing the operating mode
+ of tracing. If (<literal>flags</literal> contains <literal>PQTRACE_SUPPRESS_TIMESTAMPS</literal>),
+ then timestamp is not printed with each message.

The description of PQtrace() should be written independent of PQtraceEx(). It is an unnecessary implementation detail to the user that PQtrace() calls PQtraceEx() internally. Plus, a separate entry for PQtraceEx() needs to be added.

(46)

If skipLogging is intended for use with backend -> frontend messages only, shouldn't it be placed in conn->b_msg?

(47)
+ /* Deallocate FE/BE message tracking memory. */
+ if (conn->fe_msg &&
+ /*
+ * If fields is allocated the initial size, we reuse it next time,
+ * because it would be allocated same size and the size is not big.
+ */
+ conn->fe_msg->max_fields != DEF_FE_MSGFIELDS)

I'm not completely sure if other places interpose a block comment like this between if/for/while conditions, but I think it's better to put the comment before if.

Regards
Takayuki Tsunakawa

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2021-02-09 03:02:42 Re: repeated decoding of prepared transactions
Previous Message kuroda.hayato@fujitsu.com 2021-02-09 02:12:37 RE: parse mistake in ecpg connect string