Specifying range check in table creation : Constraints Basics « Constraints « PostgreSQL






Specifying range check in table creation


postgres=#
postgres=#
postgres=# CREATE TABLE products (
postgres(#    product_no integer,
postgres(#    name text,
postgres(#    price numeric CHECK (price > 0)
postgres(# );
CREATE TABLE
postgres=#
postgres=#
postgres=# drop table products;
DROP TABLE
postgres=#
           
       








Related examples in the same category

1.Specifying two constaint for a single table
2.Null column
3.Primary key with check option