Changes to support postgres automatically