Postgresql Function To Insert Data