A check constraint is a database rule that verifies a column value against a custom condition and rejects writes that fail it. It moves data-integrity checks into PostgreSQL rather than relying only on application code. section 2.3.1
Adding and testing a price rule
Add the constraint with ALTER TABLE: ALTER TABLE products.catalog ADD CONSTRAINT catalog_price_check CHECK (price > 0); An attempted update setting Morning Glory to -16 fails with an error identifying catalog_price_check and the failing row.

