How to identify trigger is called from the node where row is created - Mailing list pgsql-hackers

From Satish S
Subject How to identify trigger is called from the node where row is created
Date
Msg-id CAFjtqz9DQihxwpRbDk16isdenwKg=chcsJ08PcqAPv4PrqP6pQ@mail.gmail.com
Whole thread Raw
Responses Re: How to identify trigger is called from the node where row is created  ("David G. Johnston" <david.g.johnston@gmail.com>)
List pgsql-hackers
Hi,

I have a cluster of three nodes A, B, C and I'm using postgres bdr for replication.

I have some code to execute after a value change in the table, for this I have added a trigger.

When I call POST REST API from any one of the nodes it will execute the code, and on all other nodes the trigger will execute the code. The issue is the trigger will execute the code on the same node as well where POST call is happening.

Ex. POST REST API on node B. Directly execute a+b. save a and b in DB. response

Trigger activates on all nodes. And it will execute a+b on all nodes. (but I don't want to execute it again on node B)

pgsql-hackers by date:

Previous
From: Andrew Gierth
Date:
Subject: Re: gs_group_1 crashing on 13beta2/s390x
Next
From: Dilip Kumar
Date:
Subject: Re: PATCH: logical_work_mem and logical streaming of large in-progress transactions