Is it possible to use postgres triggers to split an INSERT statement into 2 tables? So if you do insert into testtable (col1, col2) values (val1a, val1b), (val2a, val2b)
, can it be translated with triggers to something like
insert into testtable (col1) values (val1a), (val1b)
insert into anothertable (col2) values (val2a), (val2b)
Basically is it possible for testtable
to not have a col2
even though the original SQL INSERT looks like col2
should exist on testtable
?
How can this be accomplished using triggers?