PostgreSQL support

Initial attempt. Need get all green. All help is welcome