Then you lose some security though, because I think Heroku uses large IPs ranges [1]. There seems to be no way to allow database access from a private IP address, other than using expensive proxying addons. That means you probably have to open up your database to 0.0.0.0/0, which is not good at all.
[1] https://stackoverflow.com/questions/15512360/get-a-finite-li...