Fixed the way postgres queries run
Fixed the way that postgres queries are done