Search code examples
postgresqltriggersplpgsql

trigger does not work for a specific table postgres 11


: LOG:  process 79596 still waiting for AccessExclusiveLock on relation 323059106 of database 16402 after 3005.513 ms

: DETAIL:  Processes holding the lock: 83081, 83080, 83083, 83082, 62764, 37865, 39707. Wait queue: 79596, 95326.

: STATEMENT:  -- Trigger: my_trigger
    
    DROP TRIGGER my_trigger ON public.payments_log;
    
    CREATE CONSTRAINT TRIGGER my_trigger
    AFTER INSERT OR UPDATE ON payments_log
    FOR EACH ROW
    EXECUTE FUNCTION my_trigger_function();

The trigger is created, but does not work. Message when creating.


Solution

  • The problem was that it was a partition table. And in fact, nothing was written there.