How to identify trigger is called from the node where row is created

From: Satish S <satishcampus(at)gmail(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: How to identify trigger is called from the node where row is created
Date: 2020-07-16 06:45:25
Message-ID: CAFjtqz9DQihxwpRbDk16isdenwKg=chcsJ08PcqAPv4PrqP6pQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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)

Thanks,
Satish

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dilip Kumar 2020-07-16 06:52:47 Re: PATCH: logical_work_mem and logical streaming of large in-progress transactions
Previous Message Andrew Gierth 2020-07-16 06:42:14 Re: gs_group_1 crashing on 13beta2/s390x