added postgres functionality