PostgreSQL queries from external IP causing high CPU load. Have I been hacked?
After using clamscan to investigate further it found another backdoor installed.

/var/lib/postgresql/9.6/main/base/12405/2613: Win.Trojan.MSShellcode-6360729-0 FOUND


I also found out that PostgreSQL 9.6 has a lot of vulnerabilties, but apt-get wouldn't find a newer version than 9.6. To upgrade to Version 10 you'll need to add 

 deb http://apt.postgresql.org/pub/repos/apt/ sid-pgdg-testing main 10


to your sources in order to upgrade via

 apt-get install postgresql-10