Search
 
SCRIPT & CODE EXAMPLE
 

SQL

how to add CHECK constraint to a column in postgres

alter table foo 
   add constraint check_positive check (some_code in ('A','B'));
Comment

how to add CHECK constraint to a column in postgres

ALTER TABLE foo
    ADD CHECK (column_1 > 2);
Comment

PREVIOUS NEXT
Code Example
Sql :: postgres set default value 
Sql :: sqlite show table definition 
Sql :: ora-01109 database not open in oracle 19c 
Sql :: truncate statement in sql 
Sql :: delete top N rows in sql 
Sql :: how to create enum in postgresql 
Sql :: select top 10 rows in sql 
Sql :: how to sort names in alphabetical order in sql 
Sql :: what is integrity constraints 
Sql :: mssql disable foreign key constraint 
Sql :: sql not equal multiple columns 
Sql :: mysql show table structure 
Sql :: grant all privileges on a db 
Sql :: show all database inside postgresql 
Sql :: sql server update to null 
Sql :: plsql triggers 
Sql :: postgresql get difference between two dates 
Sql :: is not numeric sql 
Sql :: sql date diff 
Sql :: sql compare two tables for differences 
Sql :: savepoint in sql 
Sql :: phpmyadmin password root 
Sql :: alter schema sql server 
Sql :: remove user and their privileges postgres 
Sql :: how to make a select in sql 
Sql :: mysql terminal run sql file 
Sql :: events mysql 
Sql :: foreign key constraint in ms sql 
Sql :: varchar vs nvarchar sql 
Sql :: sql server convert date to weekday 
ADD CONTENT
Topic
Content
Source link
Name
2+8 =