I am trying to create a function in postgres that retrieves data from one table and inputs into another. I am using the %ROWTYPE type to store the temporary data from the select statement and then iterate through it with an insert statement but have been unsuccessful! The following is my code : I am trying to create a function in postgres th