Sure, I have a PG database on the internet. It's firewall allows only traffic from my whitelist IPs. Additionally these PG servers require SSL[0] from only my CA so even if firewall is open, no access.
[0] https://www.postgresql.org/docs/current/static/ssl-tcp.html