public inbox for [email protected]
help / color / mirror / Atom feedDefault compression level for custom format in pg_dump ?
2+ messages / 2 participants
[nested] [flat]
* Default compression level for custom format in pg_dump ?
@ 2011-04-18 00:26 Grzegorz Szpetkowski <[email protected]>
2011-04-18 16:46 ` Re: Default compression level for custom format in pg_dump ? Alvaro Herrera <[email protected]>
0 siblings, 1 reply; 2+ messages in thread
From: Grzegorz Szpetkowski @ 2011-04-18 00:26 UTC (permalink / raw)
To: pgsql-docs
Hi,
I can't find in documentation what is implicit default compression
level for pg_dump format. There
(http://www.postgresql.org/docs/9.0/static/app-pgdump.html) is only:
"This format is also compressed by default."
"For the custom archive format, this specifies compression of
individual table-data segments, and the default is to compress at a
moderate level."
After some some reaserching I found it actually depends on zlib
library behaviour. In other words pg_dump is "zlib aware" and actually
it is 6 and it's constant value:
pg_dump someDB -Fc -f dump
pg_dump someDB -Fc -Z-1 dump (I know that -1 is not "legal", but it works)
pg_dump someDB -Fc -Z6 -f dump
In pg_dump.c there is (main function):
int compressLevel = -1;
...
else if (pg_strcasecmp(format, "c") == 0 || pg_strcasecmp(format,
"custom") == 0)
g_fout = CreateArchive(filename, archCustom, compressLevel, archModeWrite);
Then "it goes to" zlib library. According to http://www.zlib.net/manual.html:
"The compression level must be Z_DEFAULT_COMPRESSION, or between 0 and
9: 1 gives best speed, 9 gives best compression, 0 gives no
compression at all (the input data is simply copied a block at a
time). Z_DEFAULT_COMPRESSION requests a default compromise between
speed and compression (currently equivalent to level 6)."
#define Z_DEFAULT_COMPRESSION (-1) (zlib.h)
What do you think about adding some clarification in PostgreSQL doc ?
Regads,
Grzegorz Szpetkowski
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: Default compression level for custom format in pg_dump ?
2011-04-18 00:26 Default compression level for custom format in pg_dump ? Grzegorz Szpetkowski <[email protected]>
@ 2011-04-18 16:46 ` Alvaro Herrera <[email protected]>
0 siblings, 0 replies; 2+ messages in thread
From: Alvaro Herrera @ 2011-04-18 16:46 UTC (permalink / raw)
To: Grzegorz Szpetkowski <[email protected]>; +Cc: pgsql-docs
Excerpts from Grzegorz Szpetkowski's message of dom abr 17 21:26:02 -0300 2011:
> Then "it goes to" zlib library. According to http://www.zlib.net/manual.html:
>
> "The compression level must be Z_DEFAULT_COMPRESSION, or between 0 and
> 9: 1 gives best speed, 9 gives best compression, 0 gives no
> compression at all (the input data is simply copied a block at a
> time). Z_DEFAULT_COMPRESSION requests a default compromise between
> speed and compression (currently equivalent to level 6)."
>
> #define Z_DEFAULT_COMPRESSION (-1) (zlib.h)
>
> What do you think about adding some clarification in PostgreSQL doc ?
Can this behavior be tuned externally? Say by an environment var or
something. If it can, then maybe it's worth documenting it a bit more
fully (including the tuning option). Otherwise I think the current docs
are enough.
--
Álvaro Herrera <[email protected]>
The PostgreSQL Company - Command Prompt, Inc.
PostgreSQL Replication, Consulting, Custom Development, 24x7 support
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2011-04-18 16:46 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2011-04-18 00:26 Default compression level for custom format in pg_dump ? Grzegorz Szpetkowski <[email protected]>
2011-04-18 16:46 ` Alvaro Herrera <[email protected]>
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox