Easiest thing to do is to call pgsql from your servlet, have it dump the
file somewhere in your web apps directory, and then either send the link
to that file to the client or automatically forward the client there.
Option 2 would be to use JDBC to view the meta data of the table and use
it to write "CREATE" statements, and then build inserts from this data,
but this would be very time consuming and difficult to do.
Thanks!
~ Troy Campano ~
-----Original Message-----
From: pgsql-general-owner@postgresql.org
[mailto:pgsql-general-owner@postgresql.org] On Behalf Of Richard Huxton
Sent: Monday, June 07, 2004 9:57 AM
To: Tim Penhey
Cc: pgsql-general
Subject: Re: [GENERAL] Backup and Restore of PostgreSQL
Tim Penhey wrote:
> Richard Huxton mentioned:
>
>>
>>The pg_dump utility is the standard way to backup PostgreSQL and the
>>custom format is already compressed.
> The question though is how to call this from a java servlet /
hopefully in a OS
> independant way.
Well, obviously file-paths can be dealt with simply, and pg_dump will
output to a named file, so you're ok there.
As for safely calling external programs, that's probably more a question
for the servlet system (Tomcat I think you said) - it's not different to
calling any other external program.
--
Richard Huxton
Archonet Ltd
---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings