Re: Procedural Languages

Поиск
Список
Период
Сортировка
От Jeff Davis
Тема Re: Procedural Languages
Дата
Msg-id 1338499375.6178.123.camel@sussancws0025
обсуждение исходный текст
Ответ на Re: Procedural Languages  (Darren Duncan <darren@darrenduncan.net>)
Ответы Re: Procedural Languages  (Chris Travers <chris.travers@gmail.com>)
Список pgsql-general
On Thu, 2012-05-31 at 11:23 -0700, Darren Duncan wrote:
> Michael Nolan wrote:
> > PL/pgSQL and PL/perlu are the only ones I use.  I use PL/perlu primarily
> > to launch shell scripts from triggers, for example to update an external
> > website when a row in a table has been inserted, deleted or updated.
>
> There is also another way to do what you describe that might be more secure.
>
> Rather than having the DBMS launch shell scripts directly, instead use
> LISTEN/NOTIFY messaging, where the trigger posts a message, and you have an
> ordinary client script listening for them, and the client script launches the
> shell scripts when it gets a message.
>
> This way, you need a persistent client script, but you don't need to invoke the
> shell in the DBMS ... or use the untrusted version of PL/Perl if that's all it
> was for.

An additional advantage is that if you issue NOTIFY with exactly the
same message many times in one transaction, the LISTENer only gets the
message once.

In other words, a big update won't case a million rebuilds of the static
pages.

Regards,
    Jeff Davis


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

Предыдущее
От: Merlin Moncure
Дата:
Сообщение: Re: PostgreSQL 9.0.4 crashing
Следующее
От: Jeff Davis
Дата:
Сообщение: Re: pg_upgrade from 9.0.7 to 9.1.3: duplicate key pg_authid_oid_index