added postgres insertion support