Skip site navigation (1) Skip section navigation (2)

Re: directory archive format for pg_dump

From: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
To: Joachim Wieland <joe(at)mcknight(dot)de>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, José Arthur Benetasso Villanova <jose(dot)arthur(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: directory archive format for pg_dump
Date: 2010-11-29 20:21:51
Message-ID: 4CF40B5F.1010407@enterprisedb.com (view raw or flat)
Thread:
Lists: pgsql-hackers
On 29.11.2010 07:11, Joachim Wieland wrote:
> On Mon, Nov 22, 2010 at 3:44 PM, Heikki Linnakangas
> <heikki(dot)linnakangas(at)enterprisedb(dot)com>  wrote:
>> * wrap long lines
>> * use extern in function prototypes in header files
>> * "inline" some functions like _StartDataCompressor, _EndDataCompressor,
>> _DoInflate/_DoDeflate  that aren't doing anything but call some other
>> function.
>
> So here is a new round of patches. It turned out that the feature to
> allow to also restore files from a different dump and with a different
> compression required some changes in the compressor API. And in the
> end I didn't like all the #ifdefs either and made a less #ifdef-rich
> version using function pointers.

Ok. The separate InitCompressorState() and AllocateCompressorState() 
functions seem unnecessary. As the code stands, there's little 
performance gain from re-using the same CompressorState, just 
re-initializing it, and I can't see any other justification for them either.

I combined those, and the Free/Flush steps, and did a bunch of other 
editorializations and cleanups. Here's an updated patch, also available 
in my git repository at 
git://git.postgresql.org/git/users/heikki/postgres.git, branch 
"pg_dump-dir". I'm going to continue reviewing this later, tomorrow 
hopefully.

> The downside now is that I have
> created quite a few one-line functions that Heikki doesn't like all
> that much, but I assume that they are okay in this case on the grounds
> that the public compressor interface is calling the private
> implementation of a certain compressor.

You could avoid the wrapper functions by calling the function pointers 
directly, but I agree it seems neater the way you did it.

-- 
   Heikki Linnakangas
   EnterpriseDB   http://www.enterprisedb.com

Attachment: pg_dump-compression-refactor-2.diff
Description: text/x-diff (34.9 KB)

In response to

Responses

pgsql-hackers by date

Next:From: Kevin GrittnerDate: 2010-11-29 20:33:50
Subject: Re: SSI using rw-conflict lists
Previous:From: Dimitri FontaineDate: 2010-11-29 20:03:06
Subject: Re: pg_execute_from_file review

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group