X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id D4AA011F6BD4 for ; Sun, 2 Apr 2006 19:19:04 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 68333-09 for ; Sun, 2 Apr 2006 19:19:03 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from yass.opencloud.co.nz (yass.opencloud.co.nz [131.203.101.226]) by postgresql.org (Postfix) with ESMTP id 2EA8711F6B4C for ; Sun, 2 Apr 2006 19:19:01 -0300 (ADT) Received: from 203-79-104-60.cable.paradise.net.nz ([203.79.104.60] helo=[192.168.0.20]) by yass.opencloud.co.nz with asmtp (TLS-1.0:DHE_RSA_AES_128_CBC_SHA:16) (Exim 4.34) id 1FQAuT-0005H7-6f; Mon, 03 Apr 2006 10:19:01 +1200 Message-ID: <44304DD4.1000806@opencloud.com> Date: Mon, 03 Apr 2006 10:19:00 +1200 From: Oliver Jowett User-Agent: Mozilla Thunderbird 1.0.7 (X11/20051009) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Michael Schmidt CC: pgsql-jdbc@postgresql.org Subject: Re: pg_dump syntax References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.113 required=5 tests=[AWL=0.113] X-Spam-Score: 0.113 X-Spam-Level: X-Archive-Number: 200604/13 X-Sequence-Number: 14947 Michael Schmidt wrote: > Folks, > Sorry to be a bother, but I can't figure out how to do pg_dump of a > database with jdbc. I've tried a variety of syntaxes to no avail and > searched through the archives and the web with no help. Here is my last > attempt > > SELECT pg_dump -Fc -f E:\backup\test.pgb npbase > > What am I doing wrong? pg_dump is not a SQL command implemented by the DB backend. It is an executable client program that connects to the DB backend itself and runs various SQL queries to extract the database structure and data. If you want to run pg_dump from Java, you need to be using Runtime.exec() or similar. You could also reimplement pg_dump's logic using JDBC, but I strongly recommend you don't do that! -O