EnGarde Linux might be a good choice for an SQL server. It is quite lightweight, was created to be a secure server, and has a nice feel to it.
Other options might be Slackware, Vector Linux, or maybe Zenwalk? There are so many options available and so many different favourites that there is no best distro for this sector, or any of the others - it's all down to personal preference. Give the ones I've mentioned a shot, and if none of them inspire you, then ask and we will give you some more options. I do recommend EnGarde though
Oh - all distros should run PostgreSQL.
Cheers,
-jk
Ps. Welcome to LQ!!
[edit] To add to the above post, that is correct - you could install any distro you want and just kill the X server (switch to another TTY and kill it from there), choose to start the computer without it, or just not install it in the first place (an option available in most distributions' installations). However, I advise you go for a distro built to be a server..