The make_oidjoins_check script in PostgreSQL 7.4.5 and earlier allows local users to overwrite files via a symlink attack on temporary files.
https://www.ubuntu.com/usn/usn-6-1/
https://exchange.xforce.ibmcloud.com/vulnerabilities/17583
http://www.trustix.org/errata/2004/0050
http://www.securityfocus.com/bid/11295
http://www.mandriva.com/security/advisories?name=MDKSA-2004:149
http://www.debian.org/security/2004/dsa-577
http://security.gentoo.org/glsa/glsa-200410-16.xml