Open def- opened 2 years ago
In the regress tests this occasionally returned:
a | b
---+-----------------
1 | foo
(1 row)
INSERT 0 1
a | b
---+-----------------
2 | qux
(1 row)
INSERT 0 1
a | b
---+-------------------
1 | test1
2 | test2
(2 rows)
INSERT 0 2
a | b
---+-------------------
1 | test1
2 | test2
(2 rows)
While the expected is:
a | b
---+-----------------
1 | foo triggered !
(1 row)
INSERT 0 1
a | b
---+-----------------
2 | qux triggered !
(1 row)
INSERT 0 1
a | b
---+-------------------
1 | test1 triggered !
2 | test2 triggered !
(2 rows)
INSERT 0 2
a | b
---+-------------------
1 | test1 triggered !
2 | test2 triggered !
(2 rows)
Worked around by adding pg_sleep(1) after creating the triggers.
There is also this test, same problem apparently, trigger sometimes already exists immediately, sometimes not:
delete from rem2;
create trigger trig_null before insert on loc2
for each row execute procedure trig_null();
-- Nothing happens
copy rem2 from stdin;
1 foo
2 bar
\.
select * from rem2 order by f1;
Expected return:
f1 | f2
----+----
(0 rows)
Actual return is sporadically:
f1 | f2
----+-----
1 | foo
2 | bar
(2 rows)
Jira Link: DB-1301
Description
Adding a trigger with postgres_fdw doesn't always work immediately, inserting a pg_sleep seems to help. Similar to https://github.com/yugabyte/yugabyte-db/issues/11554 , but there is no error in this case, the query still succeeds but without the trigger being called.