convert sql to pg for heroku