pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
BUG #6060: does not work -z option of pg_basebackup
2+ messages / 2 participants
[nested] [flat]

* BUG #6060: does not work -z option of pg_basebackup
@ 2011-06-15 12:47 Shigehiro honda <fwif0083@mb.infoweb.ne.jp>
  2011-06-15 16:21 ` Re: BUG #6060: does not work -z option of pg_basebackup Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 2+ messages in thread

From: Shigehiro honda @ 2011-06-15 12:47 UTC (permalink / raw)
  To: pgsql-bugs


The following bug has been logged online:

Bug reference:      6060
Logged by:          Shigehiro honda
Email address:      fwif0083@mb.infoweb.ne.jp
PostgreSQL version: 9.1 beta2
Operating system:   Linux
Description:        does not work -z option of pg_basebackup
Details: 

it seems that the -z option of pg_basebackup does not work correctly. 
In getopt_long() function, there is not 'z' in 3rd argument.

And Z_DEFAULT_COMPRESSION are defined as (-1) in my zlib.h and it does only
test (compresslevel > 0) in the code, so the command does not compress
anyway.

$ diff pg_basebackup.c.DIST pg_basebackup.c
267c267
< 			if (compresslevel > 0)
---
> 			if (compresslevel > 0 || compresslevel == Z_DEFAULT_COMPRESSION )
284c284
< 			if (compresslevel > 0)
---
> 			if (compresslevel > 0 || compresslevel == Z_DEFAULT_COMPRESSION)
308c308
< 		if (compresslevel > 0)
---
> 		if (compresslevel > 0 || compresslevel == Z_DEFAULT_COMPRESSION)
328c328
< 	if (compresslevel > 0)
---
> 	if (compresslevel > 0 || compresslevel == Z_DEFAULT_COMPRESSION)
979c979
< 	while ((c = getopt_long(argc, argv, "D:F:l:Z:c:h:p:U:xwWvP",
---
> 	while ((c = getopt_long(argc, argv, "D:F:l:Z:c:h:p:U:zxwWvP",
1092c1092
< 	if (format == 'p' && compresslevel > 0)
---
> 	if (format == 'p' && ( compresslevel > 0|| compresslevel ==
Z_DEFAULT_COMPRESSION ))

regards,



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: BUG #6060: does not work -z option of pg_basebackup
  2011-06-15 12:47 BUG #6060: does not work -z option of pg_basebackup Shigehiro honda <fwif0083@mb.infoweb.ne.jp>
@ 2011-06-15 16:21 ` Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2011-06-15 16:21 UTC (permalink / raw)
  To: Shigehiro honda <fwif0083@mb.infoweb.ne.jp>; +Cc: pgsql-bugs

"Shigehiro honda" <fwif0083@mb.infoweb.ne.jp> writes:
> it seems that the -z option of pg_basebackup does not work correctly. 
> In getopt_long() function, there is not 'z' in 3rd argument.

Ooops.  Doesn't look like this got tested much (or at all).

> And Z_DEFAULT_COMPRESSION are defined as (-1) in my zlib.h and it does only
> test (compresslevel > 0) in the code, so the command does not compress
> anyway.

I think it would be sufficient to test (compresslevel != 0) in all these
places, instead of hard-wiring knowledge of Z_DEFAULT_COMPRESSION.

Will fix, thanks for the report!

> $ diff pg_basebackup.c.DIST pg_basebackup.c

BTW, plain diffs are just about useless, since patch can't apply them
safely if the code has changed at all.  Please send -c or -u format
diffs in future.

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2011-06-15 16:21 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2011-06-15 12:47 BUG #6060: does not work -z option of pg_basebackup Shigehiro honda <fwif0083@mb.infoweb.ne.jp>
2011-06-15 16:21 ` Tom Lane <tgl@sss.pgh.pa.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox