Kevin Field <kevinjamesfield(at)gmail(dot)com> writes:
> I wanted to use the SQLSTATE code, but it's always XX000. If there
> were some way to set it when calling elog()
ereport?
http://developer.postgresql.org/pgdocs/postgres/error-message-reporting.html
At the plpgsql level, since 8.4 you can specify a SQLSTATE in RAISE.
AFAIR nobody's gotten round to doing anything about it in plperl.
regards, tom lane