Re: Dynamic triggers

Поиск
Список
Период
Сортировка
От Adrian Klaver
Тема Re: Dynamic triggers
Дата
Msg-id 201006161514.12786.adrian.klaver@gmail.com
обсуждение исходный текст
Ответ на Dynamic triggers  ("Rob Richardson" <Rob.Richardson@rad-con.com>)
Список pgsql-general
On Wednesday 16 June 2010 5:29:39 am Rob Richardson wrote:
> Sid posted a link to a Wiki example of a dynamic trigger:
> http://wiki.postgresql.org/wiki/PL/pgSQL_Dynamic_Triggers
> <http://wiki.postgresql.org/wiki/PL/pgSQL_Dynamic_Triggers> .  The link
> shows a trigger, but it doesn't say anything about what its purpose is
> or what a dynamic trigger is supposed to be good for.  What is it good
> for?
>
> Thank you!
>
> RobR

The dynamic part is the EXECUTE statement. It allows you to build a query on the
fly. More importantly it overrides the default behavior of caching the plan the
first time a function is run in a session. See below for more detail:

http://www.postgresql.org/docs/8.4/interactive/plpgsql-statements.html#PLPGSQL-STATEMENTS-EXECUTING-DYN
http://www.postgresql.org/docs/8.4/interactive/plpgsql-implementation.html#PLPGSQL-PLAN-CACHING

--
Adrian Klaver
adrian.klaver@gmail.com

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

Предыдущее
От: Jeff Davis
Дата:
Сообщение: Re: consequent PQsendQueryPrepared() failed: another command is already in progress
Следующее
От: Felde Norbert
Дата:
Сообщение: postgres crash SOS