PostgreSQL 10.x before 10.1, 9.6.x before 9.6.6, 9.5.x before 9.5.10, 9.4.x before 9.4.15, 9.3.x before 9.3.20, and 9.2.x before 9.2.24 runs under a non-root operating system account, and database superusers have effective ability to run arbitrary code under that system account. PostgreSQL provides a script for starting the database server during system boot. Packages of PostgreSQL for many operating systems provide their own, packager-authored startup implementations. Several implementations use a log file name that the database superuser can replace with a symbolic link. As root, they open(), chmod() and/or chown() this log file name. This often suffices for the database superuser to escalate to root privileges when root starts the server.
https://www.postgresql.org/support/security/
https://www.postgresql.org/about/news/1801/
https://access.redhat.com/errata/RHSA-2017:3405
https://access.redhat.com/errata/RHSA-2017:3404
https://access.redhat.com/errata/RHSA-2017:3403
https://access.redhat.com/errata/RHSA-2017:3402