How to use COLUMN and TABLE options in a RAISE statement
It depends on the client-side verbosity. When using psql, issuing 

\set VERBOSITY verbose


before calling the statement would caused the error message to include:

TABLE NAME:  accounts
COLUMN NAME:  username


In recent versions of psql, it's also possible to issue \errverbose after the fact to get the last error message reformated in verbose form.