Re: session_replication_role meaning?

Поиск
Список
Период
Сортировка
От Laurenz Albe
Тема Re: session_replication_role meaning?
Дата
Msg-id 1517301376.2517.14.camel@cybertec.at
обсуждение исходный текст
Ответ на session_replication_role meaning?  (Luca Ferrari <fluca1978@gmail.com>)
Ответы Re: session_replication_role meaning?  (Jan Wieck <jan@wi3ck.info>)
Список pgsql-general
Luca Ferrari wrote:
> now this should be trivial, but I cannot udnerstand what is the
> purpose of session_replication_role
> or better, when I should use it in a way different from 'origin'.

It is used to enable or disable triggers.

By default, tables are created with all triggers enabled, which means
that they fire with the default setting "session_replication_role = origin".

You can change "session_replication_role" to "replica" to disable the firing
of triggers (unless they are set ENABLE REPLICA or ENABLE ALWAYS).
This is done by the logical replication apply worker, but you can also
use it to bypass triggers, e.g. to speed up operation, if you know what
you are doing.

What is confusing is that there are three settings for "session_replication_role",
but the two settings "local" and "origin" have the same meaning.
Maybe that was meant to change at some point, but I see no explanation in
the original discussion.

Yours,
Laurenz Albe


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

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