Open valeriaselivanova opened 5 months ago
You did not mention whether you saw https://github.com/2ndQuadrant/pglogical/tree/REL2_x_STABLE/docs#triggers and marked the trigger as ENABLE REPLICA/ENABLE ALWAYS (via ALTER TABLE ).
Yeah, sorry. I haven't marked my triggers the first time. Now I tried this
DO $$
DECLARE
trig record;
BEGIN
FOR trig IN
SELECT event_object_table, trigger_name
FROM information_schema.triggers
WHERE trigger_name LIKE 'redirect_insert%'
LOOP
EXECUTE 'ALTER TABLE public.' || quote_ident(trig.event_object_table) ||
' ENABLE ALWAYS TRIGGER ' || quote_ident(trig.trigger_name);
END LOOP;
END $$;
Triggers started to work but now the replication doesn't work correctly. For example, I have a table with 70k rows and only 100 were replicated.
Hi! I'm trying to create triggers on the subscriber that will work before
insert
in the tables. I tried different configurations but it didn't work. My triggers work when testing them on handinsert
but not while replicating. Is it a bug or how can I make it work?Here I'm creating a function that will redirect data to the different schema depending on the subscription and triggers for a few tables.