Re: Couple of issues with pg_xlogdump

From: Andres Freund <andres(at)2ndquadrant(dot)com>
To: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: Pavan Deolasee <pavan(dot)deolasee(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Couple of issues with pg_xlogdump
Date: 2013-04-23 16:05:48
Message-ID: 20130423160548.GF8499@alap2.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2013-04-23 11:51:06 -0300, Alvaro Herrera wrote:
> Andres Freund escribió:
> > On 2013-04-23 15:16:05 +0530, Pavan Deolasee wrote:
>
> > > > It works without either if you use explicit options like -s STARTADDR
> > > > and -p PATH which is frequently useful to just print a few records at
> > > > the correct point. I am not sure how could put that in there without
> > > > making it too complicated. Any suggestions?
> > > >
> > > Ah ok. Can we mention these details at in the documentation ?
> > > http://www.postgresql.org/docs/devel/static/pgxlogdump.html
> >
> > So something like:
> > At least one of STARTSEG, --start and --path or --rmgr=list has to be
> > specified.
>
> I think we need more than one synopsis line. Maybe
>
> Usage:
> pg_xlogdump [OPTION] --path=PATH --start=STARTPOS
> pg_xlogdump [OPTION] [STARTSEG [ENDSEG]]
>
> And then, under "options", do not list --path and --start (because
> that'd imply they can be used when STARTSEG is specified, which I
> understand they cannot).

Both can be used. If you specify --start and STARTSEG the address has to
be contained in the file:

if (XLogRecPtrIsInvalid(private.startptr))
XLogSegNoOffsetToRecPtr(segno, 0, private.startptr);
else if (!XLByteInSeg(private.startptr, segno))
{
fprintf(stderr,
"%s: start log position %X/%X is not inside file \"%s\"\n",
progname,
(uint32) (private.startptr >> 32),
(uint32) private.startptr,
fname);
goto bad_argument;
}

--path and STARTSEG/ENDSEG also makes sense, it will be used to locate
the file.

> Do we have any other possible operation mode? IIRC those are the only
> two possible modes.

I think so as well.

Greetings,

Andres Freund

--
Andres Freund http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2013-04-23 16:07:55 Re: putting a bgworker to rest
Previous Message Tom Lane 2013-04-23 16:05:25 Re: Proposal to add --single-row to psql