postgresql before versions 11.1, 10.6 is vulnerable to a to SQL injection in pg_upgrade and pg_dump via CREATE TRIGGER ... REFERENCING. Using a purpose-crafted trigger definition, an attacker can cause arbitrary SQL statements to run, with superuser privileges.
https://www.postgresql.org/about/news/1905/
https://usn.ubuntu.com/3818-1/
https://security.gentoo.org/glsa/201811-24
https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2018-16850
https://access.redhat.com/errata/RHSA-2018:3757