Re: libpq debug log
Alvaro Herrera <alvherre@alvh.no-ip.org>
From: Alvaro Herrera from 2ndQuadrant <alvherre@alvh.no-ip.org>
To: "Iwata, Aya" <iwata.aya@jp.fujitsu.com>
Cc: "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>, "tgl@sss.pgh.pa.us" <tgl@sss.pgh.pa.us>, "robertmhaas@gmail.com" <robertmhaas@gmail.com>, "pchampion@pivotal.io" <pchampion@pivotal.io>, "jdoty@pivotal.io" <jdoty@pivotal.io>, "raam.soft@gmail.com" <raam.soft@gmail.com>, "Nagaura, Ryohei" <nagaura.ryohei@fujitsu.com>, "nagata@sraoss.co.jp" <nagata@sraoss.co.jp>, "kommi.haribabu@gmail.com" <kommi.haribabu@gmail.com>, "peter.eisentraut@2ndquadrant.com" <peter.eisentraut@2ndquadrant.com>, 'Kyotaro HORIGUCHI' <horiguchi.kyotaro@lab.ntt.co.jp>, "Jamison, Kirk" <k.jamison@jp.fujitsu.com>
Date: 2019-09-05T22:21:22Z
Lists: pgsql-hackers
Hello,
Nice patch. I think there's pretty near consensus that this is
something we want, and that the output format of one trace msg per libpq
msg is roughly okay. (I'm not sure there's 100% agreement on this last
point, but it seems close enough.)
> I changed like this:
>
> 2019-04-04 02:39:51.488 UTC > Query 59 "SELECT pg_catalog.set_config('search_path', '', false)"
The "59" there seems quite odd, though.
* What is this in pg_conn? I don't understand why this array is of size
MAXPGPATH.
+ PGFrontendLogMsgEntry frontend_entry[MAXPGPATH];
This seems to make pg_conn much larger than we'd like.
Minor review points:
* Do we need COMMAND_B_MIN etc to reduce the number of zeroes at the
beginning of the tables?
* The place where you define TRACELOG_TIME_SIZE seems like it'll be
unavoidably out of date if somebody changes the format string. I'd put
that #define next to where the fmt appears.
* "output a a null-terminated" has duplicated "a"
* We don't add braces around single-statement blocks (pqPutMsgEnd)
* Please pgindent.
Thanks
--
Álvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
Commits
-
Rename PQtraceSetFlags() to PQsetTraceFlags().
- d0e750c0acaf 14.0 landed
-
Suppress length of Notice/Error msgs in PQtrace regress mode
- e7e341409a3d 14.0 landed
-
Strip file names reported in error messages on Windows, too.
- 53aafdb9ff6a 14.0 landed
-
Fix setvbuf()-induced crash in libpq_pipeline
- a68a894f0198 14.0 landed
-
libpq_pipeline: Must strdup(optarg) to avoid crash
- dde1a35aee62 14.0 landed
-
Remove setvbuf() call from PQtrace()
- 6ec578e60101 14.0 landed
-
Initialize conn->Pfdebug to NULL when creating a connection
- aba24b51cc1b 14.0 landed
-
Disable force_parallel_mode in libpq_pipeline
- a6d3dea8e5e0 14.0 landed
-
libpq_pipeline: add PQtrace() support and tests
- 7bebd0d00998 14.0 landed
-
Improve PQtrace() output format
- 198b3716dba6 14.0 landed
-
Re-simplify management of inStart in pqParseInput3's subroutines.
- d3a557894ce0 11.12 landed
- d2be6cdc55ad 10.17 landed
- a98e53e10dd5 9.6.22 landed
- 56defbdd0f4e 12.7 landed
- 51c54bb60309 14.0 landed
- 3580b4a0cde0 13.3 landed