database - Inserting into Postgres within a trigger function -
i have trigger function running before insert on table1. in function following:
insert table2 values(x, y, z); insert table3 values(x, a);
for reason, these insert statements not run. know function being called.
update:
more information, trigger looks this:
create trigger update_db before insert on table1 each row execute procedure update_all_db();
my procedure function doesn't much. i'm trying few statements above.
thank in advance.
semicolons (;
) missing behind statements.
and suicidal move not include column list table in persisted insert
statement. if change table definition of table2
or table3
in future, trigger silently breaks or destroys data in worst case. should be:
insert table2(col1, col2, col3) values(x, y, z); insert table3(col1, col2) values(x, a);
but that's no reason statement should "not run".
this problem due not in question.
Comments
Post a Comment