control max length of parameter values logged
Alexey Bashtanov <bashtanov@imap.cc>
From: Alexey Bashtanov <bashtanov@imap.cc>
To: PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Cc: alvherre@2ndquadrant.com, Tom Lane <tgl@sss.pgh.pa.us>
Date: 2020-02-07T13:56:52Z
Lists: pgsql-hackers
Attachments
- log_parameter_max_length_v001.patch (text/x-patch) patch v1
Hello Patch ba79cb5 (for full discussion see [1]) introduces a feature to log bind parameter values on error, which greatly helps to reproduce errors artificially having only server log -- thanks everyone who reviewed and improved it! However, it cuts the values, as some of the reviewers were worried log could fill up too quickly. This applies both to the new case of logging parameter values and to the existing ones due to log_min_duration_statement or log_statement. This is a backwards-incompatible change, and also ruins the idea of reproducible errors -- sorry Tom I failed to second this idea [2] in time, before the change was pushed. I personally don't think that we necessarily need to cut the values, we can rely on the users being careful when using this feature -- in the same way we trusted them use similarly dangerous log_min_duration_statement and especially log_statement for ages. At least it's better than having no option to disable it. Alvaro's opinion was different [3]. What do you think of adding a parameter to limit max logged parameter length? See patch attached. Best, Alex [1] https://postgr.es/m/0146a67b-a22a-0519-9082-bc29756b93a2@imap.cc [2] https://postgr.es/m/11425.1575927321%40sss.pgh.pa.us [3] https://postgr.es/m/20191209200531.GA19848@alvherre.pgsql
Commits
-
Improve user control over truncation of logged bind-parameter values.
- 0b34e7d307e6 13.0 landed