Re: Backup and restore through JDBC - Mailing list pgsql-hackers

From Tom Dunstan
Subject Re: Backup and restore through JDBC
Date
Msg-id 451D270B.6040205@tomd.cc
Whole thread Raw
In response to Re: Backup and restore through JDBC  (Markus Schaber <schabi@logix-tt.com>)
Responses Re: Backup and restore through JDBC  (Markus Schaber <schabi@logix-tt.com>)
List pgsql-hackers
Markus Schaber wrote:
> Marlon Petry wrote:
>> But I would need to have installed pg_dump and pg_restore in machine
>> client?
>> Without having installed pg_dump and pg_restore,how I could make
> 
> pg_dump and pg_restore should be runnable (possible with a small shell /
> bash wrapper script) without any "installation", simply having them and
> all neded libs lying in the current directory.

There's probably a case for having static builds of pg_dump and 
pg_restore around for various architectures, if only to help people out 
when they don't have access to a build environment etc. Either a set of 
static binaries on the website, or an easy way to build them from the 
source tree (they could then be copied to the target system).

It strikes me that Marlon hasn't really explained why he wants to use 
JDBC. I assume that your application is Java based, but trust me, 
invoking pg_dump through Runtime.exec() or whatever is going to be much, 
much easier than any of the other things you've suggested, such as 
making a pg_dump API and using JNI to call it. That's just pain city, in 
a bunch of ways.

Do you need to process the dump inside your program in some way? Or do 
you just need to store a dump and restore it later? Why the fascination 
with using an API?

> On a unix box, when you're really crazy, and want to ignore all security
> restrictions, you could even install pg_dump via inetd, and then
> everyone connecting via TCP on the appropriate port gets a dump of the
> database. :-)

Oh, man, my head just exploded reading that. That's taking evil and 
being *creative* with it. :)

Cheers

Tom



pgsql-hackers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: Block B-Tree concept
Next
From: Teodor Sigaev
Date:
Subject: Re: [COMMITTERS] pgsql: Fix IS NULL and IS NOT NULL tests on row-valued