Magnus Hagander <magnus@xxxxxxxxxxxx> writes: > Ow Mun Heng wrote: >> Am I doing something wrong? > If your trigger is defined on the head_raw_all_test_2 table, then yes. > Because it will do a new insert there, and the new insert will fire the > trigger again, which will do a new insert, which wil lfire the trigger etc. Of course, the way to have the row be inserted into the parent table is to just let the trigger return it, instead of returning null. regards, tom lane