postgres triger function in C.