Re: Q: limit the length of log file entries? - Mailing list pgsql-general

From Tom Lane
Subject Re: Q: limit the length of log file entries?
Date
Msg-id 832141.1756926428@sss.pgh.pa.us
Whole thread Raw
In response to Q: limit the length of log file entries?  (Albrecht Dreß <albrecht.dress@posteo.de>)
Responses Re: Q: limit the length of log file entries?
List pgsql-general
Albrecht =?iso-8859-1?b?RHJl3w==?= <albrecht.dress@posteo.de> writes:
> I have a PL/PGsql DB function 'addval(_id text, _data bytea) RETURNS VOID'.  When a broken bytea is passed as 2nd
parameter,something like 

> albrecht@test FEHLER:  ungültige hexadezimale Ziffer: »r« bei Zeichen 28
> albrecht@test ANWEISUNG:  SELECT FROM addval('hopp', '\xbroken')

> is printed in the log file.  This is fine and very helpful in this case, but I have a “friendly user” who transmitted
abroken hex string of ~100 KBytes as second parameter, resulting in a log line of this size which is not really
readableand when done frequently quickly fills the logs. 

There isn't any provision for limiting the length of source queries
quoted in the log.  Had your user sent the bytea value as a query
parameter, then log_parameter_max_length[_on_error] would have
applied, but this looks like the value was just inline in the query.

            regards, tom lane



pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: Q: limit the length of log file entries?
Next
From: Álvaro Herrera
Date:
Subject: Re: In-order pg_dump (or in-order COPY TO)