Re: Composite type versus Domain constraints.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: James Robinson <jlrobins(at)socialserve(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Composite type versus Domain constraints.
Date: 2005-04-12 20:48:53
Message-ID: 29773.1113338933@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

James Robinson <jlrobins(at)socialserve(dot)com> writes:
> insert into simple_table values (null, '(43)'); -- GRR works!!! It'll
> let any smallint in. What happened to the constraint?

The composite-type input routine doesn't check any constraints ...
and that includes domains. You can make it work if you don't use
a composite literal:

egression=# insert into simple_table values (null, row(43));
ERROR: value for domain "simple" violates check constraint "limits"

Obviously this whole area needs improvement. Domain constraints in
particular fail to be enforced in many places where they should be,
such as plpgsql variables.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Matt Van Mater 2005-04-12 21:58:04 psql vs perl prepared inserts
Previous Message Bruno Wolff III 2005-04-12 20:10:29 Re: client interfaces