Missing FROM-clause entry with constraint on value from type in PostgreSQL I have an issue with the following script:

CREATE DOMAIN shop.amount AS numeric(8,2) DEFAULT 0 NOT NULL CHECK (value &gt; 0::numeric);

CREATE TYPE shop.money AS (
   m_amount shop.amount,
   m_currency shop.currency
 );


CREATE TABLE shop.order_item
 (
   oi_id bigserial NOT NULL,
   oi_order_id bigint NOT NULL,
   oi_article_id bigint NOT NULL,
   oi_article_price shop.money NOT NULL,
   CONSTRAINT oi_pk_id PRIMARY KEY (oi_id),
   CONSTRAINT oi_fk_article_id FOREIGN KEY (oi_article_id)
       REFERENCES shop.article (a_id) MATCH SIMPLE
       ON UPDATE NO ACTION ON DELETE NO ACTION,
   CONSTRAINT oi_pk_order_id FOREIGN KEY (oi_order_id)
       REFERENCES shop."order" (o_id) MATCH SIMPLE
       ON UPDATE NO ACTION ON DELETE NO ACTION,
   CONSTRAINT price_cannot_be_less_than_ten CHECK (oi_article_price.m_amount &gt;= 10::numeric)
 );


When I execute the script using PGAdmin I get

ERROR:  missing FROM-clause entry for table "oi_article_price"


I guess that the error is related to the constraint, somehow. 
What's wrong?
You need to put the domain name in parentheses:

CONSTRAINT price_cannot_be_less_than_ten 
  CHECK ( (oi_article_price).m_amount &gt;= 10)