On Fri, 2007-03-16 at 20:19 +0100, Kacper Chrapa wrote:
Hi !
Is it possible in postgres to define own message for some constraint?
Example:
If i create check constraint on zip_code column , i want to get
a message: Zip code is invalid.Please,input code in format: nn-nnn
and I want to
On 3/19/07, Jeff Davis [EMAIL PROTECTED] wrote:
You can use an AFTER trigger instead of a CHECK constraint (but that may
have a performance impact - test for your application).
are you sure you meant AFTER? why? generally data-checks should be in
before triggers. i guess.
depesz
--
On Mon, Mar 19, 2007 at 07:08:41PM +0100, hubert depesz lubaczewski wrote:
On 3/19/07, Jeff Davis [EMAIL PROTECTED] wrote:
You can use an AFTER trigger instead of a CHECK constraint (but that may
have a performance impact - test for your application).
are you sure you meant AFTER? why?
On 3/19/07, Martijn van Oosterhout kleptog@svana.org wrote:
In an AFTER trigger you can be sure you're seeing what actually got
inserted. In a BEFORE trigger other triggers after you could still
modify the data...
yes but in after trigger the only thing you can do is to raise
exception. you
On Mon, 2007-03-19 at 19:08 +0100, hubert depesz lubaczewski wrote:
On 3/19/07, Jeff Davis [EMAIL PROTECTED] wrote:
You can use an AFTER trigger instead of a CHECK constraint (but that may
have a performance impact - test for your application).
are you sure you meant AFTER? why? generally
On Mon, 2007-03-19 at 19:26 +0100, hubert depesz lubaczewski wrote:
On 3/19/07, Martijn van Oosterhout kleptog@svana.org wrote:
In an AFTER trigger you can be sure you're seeing what actually got
inserted. In a BEFORE trigger other triggers after you could still
modify the data...
yes
Hi !
Is it possible in postgres to define own message for some constraint?
Example:
If i create check constraint on zip_code column , i want to get
a message: Zip code is invalid.Please,input code in format: nn-nnn
and I want to send this message to the end user.
It will be much better(in my