How to prevent recursive execution of trigger? Let\'s say I want to construct a \"tree-able\" description on chart of account. So what I do is when a new record is inserted
In pg, it's up to you to track trigger recursion.
If a trigger function executes SQL commands then these commands might fire triggers again. This is known as cascading triggers. There is no direct limitation on the number of cascade levels. It is possible for cascades to cause a recursive invocation of the same trigger; for example, an INSERT trigger might execute a command that inserts an additional row into the same table, causing the INSERT trigger to be fired again. It is the trigger programmer's responsibility to avoid infinite recursion in such scenarios.
https://www.postgresql.org/docs/13/trigger-definition.html