Julius Tuskenis <julius(at)nsoft(dot)lt> writes:
> As I've read - postgresql always generates P0001 SQLSTATE code for
> raised exceptions. Have enyone tried to distinguish one exception from
> the other in the application?
You'd have to rely on looking at the error message text.
8.4 will let you specify SQLSTATE in RAISE:
http://developer.postgresql.org/pgdocs/postgres/plpgsql-errors-and-messages.html
regards, tom lane