Csaba Nagy <nagy@ecircle-ag.com> writes:
> The responsible code is in src/backend/commands/trigger.c, and I
> think it only happens if you manage to create/drop a new trigger (which
> also could be a FK trigger created by a new foreign key referencing that
> table, as in our case) exactly between that code gets the count of the
> triggers and processes them.
All such code takes exclusive lock on the table, so the above
explanation is impossible.
regards, tom lane