Re: session_replication_role meaning?

Поиск
Список
Период
Сортировка
От Achilleas Mantzios
Тема Re: session_replication_role meaning?
Дата
Msg-id 018ec6b6-35c9-b8eb-4fc2-cb13d691d154@matrix.gatewaynet.com
обсуждение исходный текст
Ответ на session_replication_role meaning?  (Luca Ferrari <fluca1978@gmail.com>)
Список pgsql-general
On 30/01/2018 09:48, Luca Ferrari wrote:
> Hi all,
> now this should be trivial, but I cannot udnerstand what is the
> purpose of session_replication_role
> <https://www.postgresql.org/docs/10/static/runtime-config-client.html#GUC-SESSION-REPLICATION-ROLE>
> or better, when I should use it in a way different from 'origin'.
> I've a logical replication setup and both master and client
> connections default to 'origin', so it has to be specified manually.
> What is its meaning?

This has an effect on dictating how triggers are fired.
For instance if you have built your proprietary replication mechanism based on triggers (e.g. Slony, DBmirror) then you
mightwant at certain occasions (e.g. reading xactions from a master) to avoid 
 
firing triggers in order e.g. to prevent bounce back messages to the originator. If your replication trigger is a
simplyenabled trigger, then by setting session_replication_role to replica will 
 
prevent the trigger from firing. This could be useful in the code where you execute SQL originating from the master, in
ordernot to send those back and cause an endless loop.
 
>
> Thanks,
> Luca
>

-- 
Achilleas Mantzios
IT DEV Lead
IT DEPT
Dynacom Tankers Mgmt



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

Предыдущее
От: Laurenz Albe
Дата:
Сообщение: Re: Information on savepoint requirement within transctions
Следующее
От: Laurenz Albe
Дата:
Сообщение: Re: session_replication_role meaning?