Re: message for constraint

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

On 1/14/06, Peter Eisentraut <peter_e(at)gmx(dot)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 ;)

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Denis Lussier 2006-01-14 16:40:46 Re: PG process architecture
Previous Message mark 2006-01-14 16:06:07 Re: Surrogate keys (Was: enums)

Browse pgsql-patches by date

  From Date Subject
Next Message Peter Eisentraut 2006-01-14 16:30:41 Re: pg_ctl crash fix
Previous Message Magnus Hagander 2006-01-14 15:53:47 Re: pg_ctl crash fix