Specifying two constaint for a single table : Constraints Basics « Constraints « PostgreSQL






Specifying two constaint for a single table


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








Related examples in the same category

1.Null column
2.Primary key with check option
3.Specifying range check in table creation