Search Postgresql Archives

Re: Composite type versus Domain constraints.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



James Robinson <jlrobins@xxxxxxxxxxxxxxx> 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

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
      subscribe-nomail command to majordomo@xxxxxxxxxxxxxx so that your
      message can get through to the mailing list cleanly

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux