Re: pg_dump syntax

Lists: pgsql-jdbc
From: "Michael Schmidt" <michaelmschmidt(at)msn(dot)com>
To: <pgsql-jdbc(at)postgresql(dot)org>
Subject: pg_dump syntax
Date: 2006-04-02 22:06:06
Message-ID: BAY101-DAV8AC4BF1DF32B596360E74A3D40@phx.gbl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-jdbc

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?

Thanks
Michael Schmidt


From: Oliver Jowett <oliver(at)opencloud(dot)com>
To: Michael Schmidt <michaelmschmidt(at)msn(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: pg_dump syntax
Date: 2006-04-02 22:19:00
Message-ID: 44304DD4.1000806@opencloud.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-jdbc

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