Re: [HACKERS] BUG #3799: csvlog skips some logs

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, depesz <depesz(at)depesz(dot)com>, pgsql-bugs(at)postgresql(dot)org, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [HACKERS] BUG #3799: csvlog skips some logs
Date: 2007-12-10 15:04:46
Message-ID: 475D558E.2060808@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

Alvaro Herrera wrote:
> Tom Lane wrote:
>
>> Andrew Dunstan <andrew(at)dunslane(dot)net> writes:
>>
>>> Tom Lane wrote:
>>>
>>>> Well, if we want to cram all that stuff in there, how shall we do it?
>>>> It seems wrong to put all those lines into one text field, but I'm
>>>> not sure I want to add six more text fields to the CSV format
>>>> either. Thoughts?
>>>>
>>> Really? Six? In any case, would that be so bad? It would mean six extra
>>> commas per line in the log file, and nothing much in the log table
>>> unless there were content in those fields.
>>>
>> Yeah --- the lines output in the plain-stderr case that are not covered
>> in the other are
>>
>> DETAIL
>> HINT
>> QUERY (this is an internally-generated query that failed)
>> CONTEXT (think "stack trace")
>> LOCATION (reference to code file/line reporting the error)
>> STATEMENT (user query that led to the error)
>>
>
> Here is a patch to do this. It emits all of these as separate columns,
> which are output empty if they are not present. Of course, the commas
> are emitted all the time.
>

Thanks. I will look at it in detail later today.

Not sure I understand what this comment I noticed on a very brief glance
is about:

/* assume no newlines in funcname or filename... */

If it's about what to quote, we need to quote anything that might contain a newline, quote or comma. Filenames certainly come into that category.

cheers

andrew

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Alvaro Herrera 2007-12-10 15:11:44 Re: [HACKERS] BUG #3799: csvlog skips some logs
Previous Message Alvaro Herrera 2007-12-10 13:24:03 Re: [HACKERS] BUG #3799: csvlog skips some logs

Browse pgsql-hackers by date

  From Date Subject
Next Message Gregory Stark 2007-12-10 15:05:04 O(n^2) aggregates
Previous Message Stephen Frost 2007-12-10 14:49:57 Re: whats the deal with -u ?