Обсуждение: What are the minimal files required to backup a postgresql database

Поиск
Список
Период
Сортировка

What are the minimal files required to backup a postgresql database

От
Frank Church
Дата:
I need to package the ability to backup a PostgreSQL database in my application?

I obviously need to add pg_dump.exe to the package, and the dlls
required are listed below,


15/08/2007  15:41            12,288 comerr32.dll
15/08/2007  15:41           139,264 gssapi32.dll
15/08/2007  15:41            19,968 k5sprt32.dll
15/08/2007  15:41           602,112 krb5_32.dll
27/02/2007  15:39         1,040,384 libeay32.dll
31/01/2003  19:41           916,849 libiconv-2.dll
16/03/2004  16:37           898,048 libiconv2.dll
27/04/2004  10:45            32,256 libintl-2.dll
06/05/2005  17:52           103,424 libintl3.dll
31/10/2008  07:15           167,936 libpq.dll
05/11/2005  14:51           169,092 libpq81.dll
16/10/2007  13:40           348,160 msvcr71.dll
02/12/2006  00:03           626,688 msvcr80.dll
09/03/2010  16:09           520,190 sqlite3.dll
27/02/2007  15:40           196,608 ssleay32.dll

Are there any other executables besides pg_dump I need to add to this list?

If some of them are likely to come in useful, rather than necessary
for backup I don't mind adding them

Regards

/voipfc

Re: What are the minimal files required to backup a postgresql database

От
Alban Hertroys
Дата:
On 14 Jun 2010, at 14:20, Frank Church wrote:

> I need to package the ability to backup a PostgreSQL database in my application?

What are you trying to accomplish by that?

> I obviously need to add pg_dump.exe to the package, and the dlls
> required are listed below,

You can check what dll's an executable depends on by using some MS tools. There's some documentation about that in the
postgreswiki IIRC, look for debugging tools on windows. 

I don't think you'd need all of these, but I can only guess. Here are my thoughts though:

> 15/08/2007  15:41            12,288 comerr32.dll

No idea what this is.

> 15/08/2007  15:41           139,264 gssapi32.dll
> 15/08/2007  15:41            19,968 k5sprt32.dll
> 15/08/2007  15:41           602,112 krb5_32.dll

I think you only need these if you're using kerberos or GSSAPI for authentication.

> 27/02/2007  15:39         1,040,384 libeay32.dll

No idea about this one.

> 31/01/2003  19:41           916,849 libiconv-2.dll
> 16/03/2004  16:37           898,048 libiconv2.dll

These are most likely two versions of the same dll. Taking the newest should be safe.

> 27/04/2004  10:45            32,256 libintl-2.dll
> 06/05/2005  17:52           103,424 libintl3.dll

Same here.

> 31/10/2008  07:15           167,936 libpq.dll
> 05/11/2005  14:51           169,092 libpq81.dll

And same here; the libpq81.dll is probably left over from an old PG81 installation.

> 16/10/2007  13:40           348,160 msvcr71.dll
> 02/12/2006  00:03           626,688 msvcr80.dll

It needs two different runtimes? Maybe they're disjunct then?

> 09/03/2010  16:09           520,190 sqlite3.dll

No idea why you'd want SQLite in there, I can't imagine it being used by pg_dump.

> 27/02/2007  15:40           196,608 ssleay32.dll

Something to do with SSL apparently; you should only need that if you plan to use pg_dump over SSL.

>
> Are there any other executables besides pg_dump I need to add to this list?
>
> If some of them are likely to come in useful, rather than necessary
> for backup I don't mind adding them


That highly depends on what you're trying to accomplish. I'd think pg_dumpall, pg_restore and psql would be useful too.

Alban Hertroys

--
Screwing up is an excellent way to attach something to the ceiling.


!DSPAM:737,4c162b52286211582820103!



Re: What are the minimal files required to backup a postgresql database

От
Craig Ringer
Дата:
On 14/06/2010 9:14 PM, Alban Hertroys wrote:
> On 14 Jun 2010, at 14:20, Frank Church wrote:
>
>> I need to package the ability to backup a PostgreSQL database in my application?
>
> What are you trying to accomplish by that?
>
>> I obviously need to add pg_dump.exe to the package, and the dlls
>> required are listed below,
>
> You can check what dll's an executable depends on by using some MS tools. There's some documentation about that in
thepostgres wiki IIRC, look for debugging tools on windows. 

depends.exe from dependencywalker.com .

Basically, ship everything in the `bin' directory where pg_dump lives if
it's listed by depends.exe as used by pg_dump. Also make sure to provide
and silent-install the MSVC++ 2005 redist, which you can get from Microsoft.

Do *NOT* ship any system DLLs.

> Something to do with SSL apparently; you should only need that if you plan to use pg_dump over SSL.

That depends entirely on how DLL linkage is done. If it's an immediate
dependency rather than a delayed dependency, which it will be unless
configured otherwise, pg_dump will fail to load without that DLL even if
it's not going to use ssl.

I'm not on a Windows box with PG at the moment so I can't test.

--
Craig Ringer