Re: Run programs within the bin folder

Поиск
Список
Период
Сортировка
От Jeff Davis
Тема Re: Run programs within the bin folder
Дата
Msg-id 1159999643.18734.50.camel@dogma.v10.wvs
обсуждение исходный текст
Ответ на Run programs within the bin folder  ("pd" <petedawn@gmail.com>)
Список 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


В списке pgsql-general по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: now() and time zone
Следующее
От: Scott Ribe
Дата:
Сообщение: Generating synthetic keys on copy