BUG #16544: How to identify trigger is called from the node where row is created?

Поиск
Список
Период
Сортировка
От PG Bug reporting form
Тема BUG #16544: How to identify trigger is called from the node where row is created?
Дата
Msg-id 16544-e3b4bf68c80321d1@postgresql.org
обсуждение исходный текст
Ответы Re: BUG #16544: How to identify trigger is called from the node where row is created?  ("David G. Johnston" <david.g.johnston@gmail.com>)
Список pgsql-bugs
The following bug has been logged on the website:

Bug reference:      16544
Logged by:          sat
Email address:      satishcampus@gmail.com
PostgreSQL version: 12.3
Operating system:   Debian
Description:

In BDR cluster, I have multiple nodes say A and B and it has table named
'config'. 

I have created trigger (config_trigger) to listen on the table 'config'
(when CRUD operation) and the trigger is also replicated on all cluster
nodes.

Using CRUD REST, any operation can be perform on 'config' table.

On REST POST call (say on node A), I am executing some BL (say  a+b) and
saving data into the table. Since my requirement is to execute (a+b) on all
other nodes available in the cluster, I am executing BL of (a+b) from the
config_trigger. In that case, the node B will also executes (a+b).

But the issue is, node A's trigger also executes (a+b). I want to avoid it,
since in POST call it is already executed.

Is there any way, when trigger gets called, check for the source of
replication from which node? 
Or identify the trigger is called after replication happen, not on create
operation.


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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: BUG #16526: pg_test_fsync in v12 doesn't run in Windows
Следующее
От: "David G. Johnston"
Дата:
Сообщение: Re: BUG #16544: How to identify trigger is called from the node where row is created?