Re: pg_dump -Fd and compression level

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Marc Mamin <M(dot)Mamin(at)intershop(dot)de>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_dump -Fd and compression level
Date: 2015-07-28 12:45:10
Message-ID: 55B77956.10000@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


On 07/27/2015 03:52 AM, Marc Mamin wrote:
>>>> As per attached patch.
>>>>
>>>> Comments?
>>> It seems that the first test on the compression in pg_backup_tar.c is now obsolete.
>>> It didn't make much sense anyway.
>>>
>>>
>>>
>>> 211 if (AH->compression < 0 || AH->compression > 9)
>>> 212 AH->compression = Z_DEFAULT_COMPRESSION;
>>> 213
>>> 214 /* Don't compress into tar files unless asked to do so */
>>> 215 if (AH->compression == Z_DEFAULT_COMPRESSION)
>>> 216 AH->compression = 0;
>>> 217
>>> 218 /*
>>> 219 * We don't support compression because reading the files back is not
>>> 220 * possible since gzdopen uses buffered IO which totally screws file
>>> 221 * positioning.
>>> 222 */
>>> 223 if (AH->compression != 0)
>>> 224 exit_horribly(modulename,
>>> 225 "compression is not supported by tar archive format\n");
>>> 226 }
>>>
>>>
>> In fact, the first two tests look unnecessary. Neither condition should
>> be possible now.
>>
> Hello,
>
> Isn't the second test still required if you call pg_dump -Ft without setting -Z0 explicitly ?
> (=> AH->compression == Z_DEFAULT_COMPRESSION)

No. Z_DEFAULT_COMPRESSION is only set for directory and custom archive
types. See pg_dump.c at lines 578-592.

cheers

andrew

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Marc Mamin 2015-07-28 12:48:00 Re: proposal: multiple psql option -c
Previous Message Kouhei Kaigai 2015-07-28 12:38:57 Re: [DESIGN] ParallelAppend