Thread

  1. inconvenient compression options in pg_basebackup

    Peter Eisentraut <peter_e@gmx.net> — 2011-05-19T21:56:06Z

    There is no way to tell pg_basebackup to "just compress the thing in a
    default way".  You have to pick some number and then write -Z8 or
    something.  I suppose that interface was copied from pg_dump, but there
    it's not that commonly used because the right formats are compressed by
    default.
    
    I suggest we add an argument-less option -z that means "compress", and
    then -Z can be relegated to choosing the compression level.
    
    
    
  2. Re: inconvenient compression options in pg_basebackup

    Magnus Hagander <magnus@hagander.net> — 2011-05-20T18:19:42Z

    On Thu, May 19, 2011 at 17:56, Peter Eisentraut <peter_e@gmx.net> wrote:
    > There is no way to tell pg_basebackup to "just compress the thing in a
    > default way".  You have to pick some number and then write -Z8 or
    > something.  I suppose that interface was copied from pg_dump, but there
    > it's not that commonly used because the right formats are compressed by
    > default.
    
    It was copied from pg_dump, yes.
    
    
    > I suggest we add an argument-less option -z that means "compress", and
    > then -Z can be relegated to choosing the compression level.
    
    We can't just use -Z without a parameter for that?
    
    -- 
     Magnus Hagander
     Me: http://www.hagander.net/
     Work: http://www.redpill-linpro.com/
    
    
  3. Re: inconvenient compression options in pg_basebackup

    Peter Eisentraut <peter_e@gmx.net> — 2011-05-20T21:45:18Z

    On fre, 2011-05-20 at 14:19 -0400, Magnus Hagander wrote:
    > > I suggest we add an argument-less option -z that means "compress",
    > and
    > > then -Z can be relegated to choosing the compression level.
    > 
    > We can't just use -Z without a parameter for that? 
    
    You can't portably have a command-line option with an optional argument.
    
    
    
  4. Re: inconvenient compression options in pg_basebackup

    Magnus Hagander <magnus@hagander.net> — 2011-05-22T20:43:10Z

    On Fri, May 20, 2011 at 17:45, Peter Eisentraut <peter_e@gmx.net> wrote:
    > On fre, 2011-05-20 at 14:19 -0400, Magnus Hagander wrote:
    >> > I suggest we add an argument-less option -z that means "compress",
    >> and
    >> > then -Z can be relegated to choosing the compression level.
    >>
    >> We can't just use -Z without a parameter for that?
    >
    > You can't portably have a command-line option with an optional argument.
    
    Ugh.
    
    In that case, I'm fine with your suggestion.
    
    
    -- 
     Magnus Hagander
     Me: http://www.hagander.net/
     Work: http://www.redpill-linpro.com/
    
    
  5. Re: inconvenient compression options in pg_basebackup

    Peter Eisentraut <peter_e@gmx.net> — 2011-05-24T18:40:35Z

    On sön, 2011-05-22 at 16:43 -0400, Magnus Hagander wrote:
    > On Fri, May 20, 2011 at 17:45, Peter Eisentraut <peter_e@gmx.net> wrote:
    > > On fre, 2011-05-20 at 14:19 -0400, Magnus Hagander wrote:
    > >> > I suggest we add an argument-less option -z that means "compress",
    > >> and
    > >> > then -Z can be relegated to choosing the compression level.
    > >>
    > >> We can't just use -Z without a parameter for that?
    > >
    > > You can't portably have a command-line option with an optional argument.
    > 
    > Ugh.
    > 
    > In that case, I'm fine with your suggestion.
    
    Quick patch for verification.  I chose the naming -z/--gzip to mirror
    GNU tar.
    
  6. Re: inconvenient compression options in pg_basebackup

    Tom Lane <tgl@sss.pgh.pa.us> — 2011-05-24T19:34:17Z

    Peter Eisentraut <peter_e@gmx.net> writes:
    > Quick patch for verification.  I chose the naming -z/--gzip to mirror
    > GNU tar.
    
    I would argue that -Z ought to turn on "gzip" without my having to write
    -z as well (at least when the argument is greater than zero; possibly
    -Z0 should be allowed as meaning "no compression").
    
    Other than that (and the ensuing docs and help changes), looks fine.
    
    			regards, tom lane
    
    
  7. Re: inconvenient compression options in pg_basebackup

    Peter Eisentraut <peter_e@gmx.net> — 2011-05-26T19:26:39Z

    On tis, 2011-05-24 at 15:34 -0400, Tom Lane wrote:
    > I would argue that -Z ought to turn on "gzip" without my having to
    > write
    > -z as well (at least when the argument is greater than zero; possibly
    > -Z0 should be allowed as meaning "no compression"). 
    
    My concern with that is that if we ever add another compression method,
    would we then add another option to control the compression level of
    that method?
    
    
    
  8. Re: inconvenient compression options in pg_basebackup

    Tom Lane <tgl@sss.pgh.pa.us> — 2011-05-26T20:54:14Z

    Peter Eisentraut <peter_e@gmx.net> writes:
    > On tis, 2011-05-24 at 15:34 -0400, Tom Lane wrote:
    >> I would argue that -Z ought to turn on "gzip" without my having to write
    >> -z as well (at least when the argument is greater than zero; possibly
    >> -Z0 should be allowed as meaning "no compression"). 
    
    > My concern with that is that if we ever add another compression method,
    > would we then add another option to control the compression level of
    > that method?
    
    Um ... what's your point?  Forcing the user to type two switches instead
    of one isn't going to make that hypothetical future extension any
    easier, AFAICS.
    
    But if you want to take such an extension into account right now, maybe
    we ought to design that feature now.  What are you seeing it as looking
    like?
    
    My thought is that "-z" should just mean "give me compression; a good
    default compression setting is fine".  "-Zn" could mean "I want gzip
    with exactly this compression level" (thus making the presence or
    absence of -z moot).  If you want to specify some other compression
    method altogether, use something like --lzma=N.  It seems unlikely to me
    that somebody who wants to override the default compression method
    wouldn't want to pick the settings for it too.
    
    			regards, tom lane
    
    
  9. Re: inconvenient compression options in pg_basebackup

    Peter Eisentraut <peter_e@gmx.net> — 2011-05-26T21:04:21Z

    On tor, 2011-05-26 at 16:54 -0400, Tom Lane wrote:
    > But if you want to take such an extension into account right now,
    > maybe we ought to design that feature now.  What are you seeing it as
    > looking like?
    > 
    > My thought is that "-z" should just mean "give me compression; a good
    > default compression setting is fine".  "-Zn" could mean "I want gzip
    > with exactly this compression level" (thus making the presence or
    > absence of -z moot).  If you want to specify some other compression
    > method altogether, use something like --lzma=N.  It seems unlikely to
    > me that somebody who wants to override the default compression method
    > wouldn't want to pick the settings for it too. 
    
    I think of pg_basebackup as analogous to tar.  tar has a bunch of
    options to set a compression method (-Z, -z, -j, -J), but no support for
    setting compression specific options.  So in that sense that contradicts
    your suspicion.
    
    
    
  10. Re: inconvenient compression options in pg_basebackup

    Tom Lane <tgl@sss.pgh.pa.us> — 2011-05-26T21:11:12Z

    Peter Eisentraut <peter_e@gmx.net> writes:
    > On tor, 2011-05-26 at 16:54 -0400, Tom Lane wrote:
    >> But if you want to take such an extension into account right now,
    >> maybe we ought to design that feature now.  What are you seeing it as
    >> looking like?
    >> 
    >> My thought is that "-z" should just mean "give me compression; a good
    >> default compression setting is fine".  "-Zn" could mean "I want gzip
    >> with exactly this compression level" (thus making the presence or
    >> absence of -z moot).  If you want to specify some other compression
    >> method altogether, use something like --lzma=N.  It seems unlikely to
    >> me that somebody who wants to override the default compression method
    >> wouldn't want to pick the settings for it too. 
    
    > I think of pg_basebackup as analogous to tar.  tar has a bunch of
    > options to set a compression method (-Z, -z, -j, -J), but no support for
    > setting compression specific options.  So in that sense that contradicts
    > your suspicion.
    
    I would think we'd be more concerned about preserving an analogy to
    pg_dump, which most certainly does expose compression-quality options.
    
    			regards, tom lane