Re: Execute Shell script after insert

Поиск
Список
Период
Сортировка
От David Fetter
Тема Re: Execute Shell script after insert
Дата
Msg-id 20081027201934.GI15649@fetter.org
обсуждение исходный текст
Ответ на Execute Shell script after insert  ("Anderson dos Santos Donda" <andersondonda@gmail.com>)
Список pgsql-general
On Mon, Oct 27, 2008 at 03:09:31PM -0300, Anderson dos Santos Donda wrote:
> Is there a way to execute a simple shell script in server after execute
> INSERT INTO ?
>
> Example?
>
> INSERT INTO clients (name) VALUES ('Donda');
>
> after it, execute shell : mkdir $1

This will scale better if you batch it, as in:

INSERT INTO clients (name, status)
VALUES
    ('Donda', 'inserted_no_directory'),
    ('Eonda', 'inserted_no_directory'),
    ('Fonda', 'inserted_no_directory'),
    ...

Once you're done loading, sweep through the ones so marked.

Cheers,
David.
--
David Fetter <david@fetter.org> http://fetter.org/
Phone: +1 415 235 3778  AIM: dfetter666  Yahoo!: dfetter
Skype: davidfetter      XMPP: david.fetter@gmail.com

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Execute Shell script after insert
Следующее
От: Chris Browne
Дата:
Сообщение: Re: Execute Shell script after insert