Re: [PATCHES] COPYable logs - Mailing list pgsql-hackers

From Andrew Dunstan
Subject Re: [PATCHES] COPYable logs
Date
Msg-id 46C8740F.3020505@dunslane.net
Whole thread Raw
Responses Re: [PATCHES] COPYable logs  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
[redirected to -hackers]

Tom Lane wrote:
> Another thing that needs to be looked at carefully is how much memory
> write_csvlog() eats.  I'm a little bit concerned about whether it will
> result in infinite recursion when our backs are against the wall and
> we only have the original 8K in ErrorContext to work in.  (We could
> increase that figure if need be, but we need to know by how much.)
>
>
>   


I think we can make a saving by rearranging the end of 
send_message_to_server_log() so we can call pfree(buf.data) before we 
call write_csvlog(). We can probably make a further saving by changing 
how we put the CSV-escaped error message on the end of the buffer we 
send down the pipe. I will look into those.

If these prove difficult, I'd say 24K would put us in an equivalent 
position (two extra copies of the error message plus change). Even so, 
I'm inclined to say that 8K is very tight. It might be enough for very 
small startup messages, but is the context size likely to stay at 8K for 
non-trivial uses? A single logged complex query or function body would 
easily blow it.

cheers

andrew




pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: INSERT/SELECT and excessive foreign key checks
Next
From: Tom Lane
Date:
Subject: Re: [PATCHES] COPYable logs