Port forwarding through SSH is allowed everywhere by default, which is a lot of trust for an account that only needs to reach one database. PermitOpen narrows it to the destinations you list.
Match User tunnel
PermitOpen db.example.com:5432
Put it in sshd_config, here inside a Match block so it only applies to one user. That user can now forward to port 5432 on that host and nowhere else. Several destinations go on one line, separated by whitespace. The value any removes all restrictions and none prohibits all forwarding requests. The wildcard * works for the host or the port. The default is that all port forwarding requests are permitted.
Check the file before you reload, so a typo doesn’t lock you out:
sudo sshd -t
Two caveats from the man page. First, no pattern matching or address lookups happen on the names, so the destination has to be written the way the client asks for it. A hostname in the list is not looked up and compared with an IP address. Second, this only covers TCP port forwarding. The man page also warns, for AllowTcpForwarding, that turning forwarding off doesn’t improve security unless users are also denied shell access, because they can install their own forwarders. I’d keep that in mind for this setting too.
Further reading: sshd_config(5)