Custom Contraint Violation Errors - Mailing list pgsql-general

From Michael Musenbrock
Subject Custom Contraint Violation Errors
Date
Msg-id 20111104065622.135750@gmx.net
Whole thread Raw
Responses Re: Custom Contraint Violation Errors  (Richard Broersma <richard.broersma@gmail.com>)
List pgsql-general
Hi,

I'm looking for a way to create a custom, for our application parsable,
error message on constraint violation.
The perfect thing would be, having table names, schemas and primary keys
in that error message.

My first thought was to create a function which gets triggered by the
constraint violation, which creates the custom error. But I have not
found any information if this is possible to create a trigger on a
constraint violation, and if yes, how could that be done?

I would be glad, If someone could light me up on that issue.

Thanks in advance and Kind Regards,
Michael
--
Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir
belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.gmx.de

pgsql-general by date:

Previous
From: Steve Murphy
Date:
Subject: What is *wrong* with this query???
Next
From: Graham Murray
Date:
Subject: Re: postgresql-9.1.1 PQescapeByteaConn() generating incorrectly quoted output.