Re: message for constraint

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Jaime Casanova <systemguards(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: message for constraint
Date: 2006-01-14 09:13:47
Message-ID: 200601141013.47717.peter_e@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Jaime Casanova wrote:
> From time to time people ask me if there is a way to "customize"
> messages for constraints so they could be more informative to the
> user...

What about this?

=> create table foo (fld int4 constraint "fld must contain positive numbers" check (fld > 0));
CREATE TABLE
=> insert into foo values (-5);
ERROR: new row for relation "foo" violates check constraint "fld must contain positive numbers"

--
Peter Eisentraut
http://developer.postgresql.org/~petere/

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Glaesemann 2006-01-14 10:28:21 Re: Surrogate keys (Was: enums)
Previous Message Jaime Casanova 2006-01-14 04:53:20 message for constraint

Browse pgsql-patches by date

  From Date Subject
Next Message Magnus Hagander 2006-01-14 13:55:45 pg_ctl crash fix
Previous Message Jaime Casanova 2006-01-14 04:53:20 message for constraint