Thread: CSVlog vs tabs

CSVlog vs tabs

From
Andrew Dunstan
Date:
Now that we've fixed the partial/interleaved log line issue, I have 
returned to trying toi get the CSV log patch into shape. Sadly, it still 
needs lots of work, even after Greg Smith and I both attacked it, so I 
am now going through it with a fine tooth comb.

One issue I notice is that it mangles the log message to add a tab 
character before each newline. We do this in standard text logs to make 
them more readable for humans. but the whole point of having CSV logs is 
to make them machine readable, and I'm rather inclined to think this 
sort of behaviour is both unnecessary and undesirable.  So I'm intending 
to leave it out for CSV logs.

Comments?

cheers

andrew


Re: CSVlog vs tabs

From
"Joshua D. Drake"
Date:
Andrew Dunstan wrote:
> 
> Now that we've fixed the partial/interleaved log line issue, I have 
> returned to trying toi get the CSV log patch into shape. Sadly, it still 
> needs lots of work, even after Greg Smith and I both attacked it, so I 
> am now going through it with a fine tooth comb.
> 
> One issue I notice is that it mangles the log message to add a tab 
> character before each newline. We do this in standard text logs to make 
> them more readable for humans. but the whole point of having CSV logs is 
> to make them machine readable, and I'm rather inclined to think this 
> sort of behaviour is both unnecessary and undesirable.  So I'm intending 
> to leave it out for CSV logs.
> 
> Comments?

I would agree. The only thing we need is whatever the CSV delimiter.

Joshua D. Drake

> 
> cheers
> 
> andrew
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Have you searched our list archives?
> 
>               http://archives.postgresql.org
> 


-- 
      === The PostgreSQL Company: Command Prompt, Inc. ===
Sales/Support: +1.503.667.4564 || 24x7/Emergency: +1.800.492.2240
Providing the most comprehensive  PostgreSQL solutions since 1997             http://www.commandprompt.com/

Donate to the PostgreSQL Project: http://www.postgresql.org/about/donate
PostgreSQL Replication: http://www.commandprompt.com/products/



Re: CSVlog vs tabs

From
Tom Lane
Date:
Andrew Dunstan <andrew@dunslane.net> writes:
> One issue I notice is that it mangles the log message to add a tab 
> character before each newline. We do this in standard text logs to make 
> them more readable for humans. but the whole point of having CSV logs is 
> to make them machine readable, and I'm rather inclined to think this 
> sort of behaviour is both unnecessary and undesirable.  So I'm intending 
> to leave it out for CSV logs.

Right, the tabs are only there to disambiguate the plain-text format.
        regards, tom lane


Re: CSVlog vs tabs

From
"FAST PostgreSQL"
Date:
Andrew Dunstan wrote:
> 
> Now that we've fixed the partial/interleaved log line issue, I have 
> returned to trying toi get the CSV log patch into shape. Sadly, it still 
> needs lots of work, even after Greg Smith and I both attacked it, so I 
> am now going through it with a fine tooth comb.
> 
> One issue I notice is that it mangles the log message to add a tab 
> character before each newline. We do this in standard text logs to make 
> them more readable for humans. but the whole point of having CSV logs is 
> to make them machine readable, and I'm rather inclined to think this 
> sort of behaviour is both unnecessary and undesirable.  So I'm intending 
> to leave it out for CSV logs.
> 
> Comments?
> 
With tab characters in the log, the user has to only enable csvlog to 
have both machine and human readable logs. The user can use the csvlog 
always and use it for human reading and load it into the database only 
if he wants it for further analysis. That was my original intention anyway.

(Also as I wrote the patch some time ago, I forgot how the loaded log 
gets displayed after a select. If it gets displayed with the tabs, then 
isn't it desirable that way as well?)

Rgds,
Arul Shaji



> cheers
> 
> andrew
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Have you searched our list archives?
> 
>               http://archives.postgresql.org
> 
> 



Re: CSVlog vs tabs

From
Andrew Dunstan
Date:

FAST PostgreSQL wrote:
>
> Andrew Dunstan wrote:
>>
>> Now that we've fixed the partial/interleaved log line issue, I have 
>> returned to trying toi get the CSV log patch into shape. Sadly, it 
>> still needs lots of work, even after Greg Smith and I both attacked 
>> it, so I am now going through it with a fine tooth comb.
>>
>> One issue I notice is that it mangles the log message to add a tab 
>> character before each newline. We do this in standard text logs to 
>> make them more readable for humans. but the whole point of having CSV 
>> logs is to make them machine readable, and I'm rather inclined to 
>> think this sort of behaviour is both unnecessary and undesirable.  So 
>> I'm intending to leave it out for CSV logs.
>>
>> Comments?
>>
> With tab characters in the log, the user has to only enable csvlog to 
> have both machine and human readable logs. The user can use the csvlog 
> always and use it for human reading and load it into the database only 
> if he wants it for further analysis. That was my original intention 
> anyway.

I think it's more important to have the machine readable version not 
embelish the query in any way.



>
> (Also as I wrote the patch some time ago, I forgot how the loaded log 
> gets displayed after a select. If it gets displayed with the tabs, 
> then isn't it desirable that way as well?)
>
>

I don't think tabs will help that much. In psql, expanded output mode is 
likely to be better anyway.

cheers

andrew