finished initial postgresql storage implementation