Custom Contraint Violation Errors

From: "Michael Musenbrock" <redeamer(at)gmx(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: Custom Contraint Violation Errors
Date: 2011-11-04 06:56:22
Message-ID: 20111104065622.135750@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Stuart Bishop 2011-11-04 07:11:20 Excessive planner time for some queries with high statistics
Previous Message Uwe Schroeder 2011-11-04 06:52:39 Re: Hint for a query