Обсуждение: BUG #16544: How to identify trigger is called from the node where row is created?

Поиск
Список
Период
Сортировка

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

От
PG Bug reporting form
Дата:
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.


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

От
"David G. Johnston"
Дата:


On Wednesday, July 15, 2020, PG Bug reporting form <noreply@postgresql.org> wrote:
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'.

This isn’t the right mailing list for this topic.  It isn’t a bug report.  Moreover, core PostgreSQL doesn’t have BDR so this seems like it should directed to whichever product is providing that capability.  I’m pretty sure that nothing in core PostgreSQL ties nodes to data.  But if you want explore this on the community lists you want to send to the -general list, not the bug reporting one.

David J.