Search Postgresql Archives

application readable error message

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,
I am trying to return an application error message on certain db
raised errors to the form the info  came from.
What is the usual way for an application to identify the source of an
error?
The info (error type, table, column) is sometimes in the error message
sometimes not, but even when it is there trying to pars the human
readable message is surely not the best approach.

How do you people do it?
Thanks for the help.
SWK

Eg.
- null value in column "langid" violates not-null constraint - non-
null constraint violation, column, table
- ERROR:  insert or update on table "instrumentheader" violates
foreign key constraint "instrumentheader_fk"
  DETAIL:  Key (langid)=(ddd) is not present in table "lang". -
foreign key violation, column, table
  ERROR: ExecInsert: rejected due to CHECK constraint "username_valid"
  on "users" - check constraint violation, column, table
- ERROR:  invalid input syntax for integer: "sss" - datatype mismatch,
column, table


-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux