Database figuring out
postgresql stuff