Postgresql 9.2 "invalid locale name" on Ubuntu 12.04

If PostgreSQL hasn't been restarted after the new locale has been created, that would be the reason. service postgresql restart should suffice.

This is presumably due to how locales are implemented in Linux libc. The new locales don't get seamlessly imported into the environment of already running processes.