PostgreSQL 11 trigger can't select a value in a table to use it in a second table
There are many errors:


It must be a BEFORE trigger to modify the row about to be inserted.
There is no column base in table log.
TG_OP is always in upper case, so you must compare with 'INSERT'.