Fixed things from the change to pg, added the views for sorting the records