Postgresql Create Function Insert Into Sql With Where Clause