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

From Adrian Klaver
Subject Re: Q: limit the length of log file entries?
Date
Msg-id a02b1b2e-e35b-4cf0-8888-84bbc6816ff6@aklaver.com
Whole thread Raw
In response to Re: 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
On 9/4/25 08:48, Albrecht Dreß wrote:
> Am 03.09.25 21:07 schrieb(en) Tom Lane:
>> There isn't any provision for limiting the length of source queries
>> quoted in the log.
> 
> I see, thanks for the clarification.  IMHO, it would be nice to have such an option, though…
> 
>> 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.
> 
> I can confirm that the limitation is applied when I call PQexecParams() from a little c test application with the
dataincluded in the paramValues array.  The overlong log lines result from queries in a Python script using the
psycopg2module – no idea how this component formats the query.
 

The best explanation is found from the psycopg(3) docs:

https://www.psycopg.org/psycopg3/docs/basic/from_pg2.html

Differences from psycopg2

"Psycopg 3 sends the query and the parameters to the server separately, 
instead of merging them on the client side. Server-side binding works 
for normal SELECT and data manipulation statements (INSERT, UPDATE, 
DELETE), but it doesn’t work with many other statements. For instance, 
it doesn’t work with SET or with NOTIFY:"


> 
> Thanks again,
> Albrecht.


-- 
Adrian Klaver
adrian.klaver@aklaver.com



pgsql-general by date:

Previous
From: Albrecht Dreß
Date:
Subject: Re: Q: limit the length of log file entries?
Next
From: Dimitrios Apostolou
Date:
Subject: Re: In-order pg_dump (or in-order COPY TO)