Re: libpq debug log
Robert Haas <robertmhaas@gmail.com>
From: Robert Haas <robertmhaas@gmail.com>
To: "Iwata, Aya" <iwata.aya@jp.fujitsu.com>
Cc: "Jamison, Kirk" <k.jamison@jp.fujitsu.com>, "Nagaura, Ryohei" <nagaura.ryohei@jp.fujitsu.com>,
Jacob Champion <pchampion@pivotal.io>, Jim Doty <jdoty@pivotal.io>,
PostgreSQL mailing lists <pgsql-hackers@postgresql.org>, "nagata@sraoss.co.jp" <nagata@sraoss.co.jp>, Tom Lane <tgl@sss.pgh.pa.us>, Haribabu Kommi <kommi.haribabu@gmail.com>, Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Date: 2019-02-22T15:41:02Z
Lists: pgsql-hackers
On Thu, Feb 21, 2019 at 7:52 PM Iwata, Aya <iwata.aya@jp.fujitsu.com> wrote: > > I'm not really sure that I like the design of this patch in any way. > Aside from problems with my current documentation which I will fix, > could you explain more detail about the problem of the design? > I would like to improve my current implementation based from feedback. Well, I believe that what you've got here is something that could, perhaps, be occasionally useful. However, I don't think it would be useful to very many people very often, and we'd still have to maintain the code, so that's not a great situation. We already have a PQtrace() facility that could be improved, and it has been previously suggested that you work on improving this facility rather than inventing something new. I still think that's a good idea. Instead you've created a second way of producing similar information, and then coupled it to very specific ideas about how that information should be logged: it is triggered by new libpq parameters, there is log rotation logic, etc. Those might not be right for everyone, and there's no flexibility in the mechanism. I am not sure that it's a good idea to have facilities that write to the local filesystem that can be triggered by libpq parameters. Seems like that might have possible security consequences, or at least annoy people who want to accept connection strings from users without having to sanitize them for these sorts of options. I do sometimes want to know what's going on at the protocol level. Sometimes it's possible to use wireshark for that (as mentioned upthread) and when it isn't, the thing I'd really like is for the command-line clients that already exist have an option to enable PQtrace without me having to hack the C code. We could go through and add a long-form command-line option, --libpq-trace, to every command-line tool we ship, for example. Then we could, as a separate patch, improve the format of that tracing output. For me that would be more useful than this. I don't necessarily think there's anything deeply wrong with this approach. It's not like your patch will bring about the end of civilization or anything like that. It just doesn't excite me very much. And since I agree that we have a problem in this area, I would ideally like to have a solution to that problem that I feel excited about. -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company
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