Re: REFERENCES error message complaint, suggestion

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Karl O(dot) Pinc" <kop(at)meme(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: REFERENCES error message complaint, suggestion
Date: 2004-03-04 15:13:33
Message-ID: 25767.1078413213@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Karl O. Pinc" <kop(at)meme(dot)com> writes:
> Does 7.4 do something similar with CHECK constraints?

Nope, just

regression=# create table baz(f1 int check (f1 > 0));
CREATE TABLE
regression=# insert into baz values(-1);
ERROR: new row for relation "baz" violates check constraint "baz_f1"
regression=#

I think this is sufficient though, and that database designers ought to
choose helpful names for constraints. I should have said something like
... constraint "f1 must be positive" check (f1 > 0)
if I were concerned about the error message quality.

I didn't care much for your suggestion of showing the constraint
expression, because to the average non-programmer it would just be
noise.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Bruno Wolff III 2004-03-04 15:27:26 Re: Moving from MySQL to PGSQL....some questions (multilevel
Previous Message Marc G. Fournier 2004-03-04 15:09:57 Re: META: Filtering viruses/worms