Re: Run programs within the bin folder

From: Jeff Davis <pgsql(at)j-davis(dot)com>
To: pd <petedawn(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Run programs within the bin folder
Date: 2006-10-04 22:07:23
Message-ID: 1159999643.18734.50.camel@dogma.v10.wvs
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, 2006-10-02 at 22:56 -0700, pd wrote:
> guys,
>
> is there a way to run various programs like (pg_config, pg_restore,
> dropdb etc) from within pgadmin or from within my java code. i mean can
> i perform database administration from within postgres that is without
> using literal commands. so from within my java code i can execute a
> query like select all etc. but can i also execute a query which will
> perform database administration.
>
> i mean when my java code says "select all" it doesnt have psql in front
> of it. so why when i have to backup or do anything else i need to use
> pg_dump and not a general query (which really makes things very
> complicate programmatically).
>

First of all, some administration can be easily performed with queries,
such as CREATE DATABASE, DROP DATABASE, CREATE LANGUAGE, etc.

To work with something like pg_dump, just open a pipe. Generally you
want to output to a file anyway. It would be odd to have something like
a pg_dump api call that dumped information out as a Java string. If
nothing else, you might not be able to store the entire string in
memory, so the interface of unix pipes is much better.

Regards,
Jeff Davis

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Scott Ribe 2006-10-04 23:16:17 Generating synthetic keys on copy
Previous Message Tom Lane 2006-10-04 21:09:41 Re: now() and time zone