working postgres database stuff

postgres stuff fixed