Re: pg_xlogdump --stats - Mailing list pgsql-hackers

From Abhijit Menon-Sen
Subject Re: pg_xlogdump --stats
Date
Msg-id 20140630063506.GA26503@toroid.org
Whole thread Raw
In response to Re: pg_xlogdump --stats  (Dilip kumar <dilip.kumar@huawei.com>)
Responses Re: pg_xlogdump --stats  (Abhijit Menon-Sen <ams@2ndQuadrant.com>)
List pgsql-hackers
At 2014-06-30 05:19:10 +0000, dilip.kumar@huawei.com wrote:
>
> I have started reviewing the patch..

Thanks.

> 1. Patch applied to git head cleanly.
> 2. Compiled in Linux  -- Some warnings same as mentioned by furuyao

I've attached an updated version of the patch which should fix the
warnings by using %zu.

> 3. Some compilation error in windows
> .\contrib\pg_xlogdump\pg_xlogdump.c(1002) : error C2065: 'optional_argument' : undeclared identifier
> .\contrib\pg_xlogdump\pg_xlogdump.c(1002) : error C2099: initializer is not a constant
>
> optional_argument should be added to getopt_long.h file for windows.

Hmm. I have no idea what to do about this. I did notice when I wrote the
code that nothing else used optional_argument, but I didn't realise that
it wouldn't work on Windows.

It may be that the best thing to do would be to avoid using
optional_argument altogether, and have separate --stats and
--stats-per-record options. Thoughts?

> Please fix these issues and send the updated patch..

I've also attached a separate patch to factor out the identify_record
function into rm_identify functions in the individual rmgr files, so
that the code can live next to the respective _desc functions.

This allows us to remove a number of #includes from pg_xlogdump, and
makes the code a bit more straightforward to read.

-- Abhijit

Attachment

pgsql-hackers by date:

Previous
From: Rajeev rastogi
Date:
Subject: Re: psql: show only failed queries
Next
From: Abhijit Menon-Sen
Date:
Subject: Re: pg_xlogdump --stats