You're on an old PostgreSQL version.
application_name
was introduced in 9.0. Compare to the 8.4 documentation with the link at the top.
You need to upgrade or skip using the feature.
In general, if you get errors that indicate that PostgreSQL has no idea what you're talking about - functions not found, views missing, syntax errors on what looks like the documented syntax, etc - then you should be thinking "am I reading the manual for my version".