Re: [PATCHES] COPYable logs

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCHES] COPYable logs
Date: 2007-08-19 16:47:11
Message-ID: 46C8740F.3020505@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches


[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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2007-08-19 16:58:44 Re: [PATCHES] COPYable logs
Previous Message Tom Lane 2007-08-19 16:38:49 Re: INSERT/SELECT and excessive foreign key checks

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2007-08-19 16:58:44 Re: [PATCHES] COPYable logs
Previous Message Merlin Moncure 2007-08-18 14:46:53 Re: pgparam extension to the libpq api