Re: message for constraint - Mailing list pgsql-hackers

From Jaime Casanova
Subject Re: message for constraint
Date
Msg-id c2d9e70e0601140817y69d1f2dap6a0bab0e2bf849b1@mail.gmail.com
Whole thread Raw
In response to Re: message for constraint  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-hackers
On 1/14/06, Peter Eisentraut <peter_e@gmx.net> wrote:
> 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/
>

ok, i didn't know you can use such names...

--
regards,
Jaime Casanova
(DBA: DataBase Aniquilator ;)


pgsql-hackers by date:

Previous
From: mark@mark.mielke.cc
Date:
Subject: Re: Surrogate keys (Was: enums)
Next
From: Denis Lussier
Date:
Subject: Re: PG process architecture