[PostgreSQL] CHECK Constraint

2022. 5. 4. 18:29·DataBase/PostgreSQL

 

 

When to use?

특정 attribute 의 값의 범위를 강제할 때.

ex) birth_date DATE CHECK (birth_date > '1900-01-01')

age INT CHECK (age between 0 and 100)

 

 

How to use?

 

네이밍 컨벤션

<table_name>_<column_name>_check

 

 

CREATE TABLE

ALTER TABLE

 

🔗 Reference

 

PostgreSQL CHECK Constraint

Summary: in this tutorial, you will learn about the PostgreSQL CHECK constraints and how to use them to constrain values in columns of a table based on a boolean expression. A CHECK constraint is a kind of constraint that allows you to specify if values in

www.postgresqltutorial.com

 

저작자표시 (새창열림)

'DataBase > PostgreSQL' 카테고리의 다른 글

[PostgreSQL] Delete duplicates in array  (0) 2022.06.22
[PostgreSQL] Use `identity` instead of `serial`  (0) 2022.06.16
[PostgreSQL] Trigger + Transaction  (0) 2022.04.18
[PostgreSQL] Transaction + Pool 사용시 주의  (0) 2022.04.04
[PostgreSQL] Function (feat. trigger)  (0) 2022.03.29
'DataBase/PostgreSQL' 카테고리의 다른 글
  • [PostgreSQL] Delete duplicates in array
  • [PostgreSQL] Use `identity` instead of `serial`
  • [PostgreSQL] Trigger + Transaction
  • [PostgreSQL] Transaction + Pool 사용시 주의
M_Falcon
M_Falcon
  • M_Falcon
    Falcon
    M_Falcon
  • 전체
    오늘
    어제
    • 분류 전체보기 (432)
      • Web (16)
        • Nodejs (14)
        • Javascript (23)
        • FrontEnd (4)
      • DataBase (39)
        • Fundamental (1)
        • Redis (4)
        • PostgreSQL (10)
        • NoSQL (4)
        • MySQL (9)
        • MSSQL (3)
        • Error (4)
      • Algorithm (79)
        • Algorithm (문제풀이) (56)
        • Algorithm (이론) (23)
      • JVM (65)
        • Spring (13)
        • JPA (5)
        • Kotlin (13)
        • Java (24)
        • Error (7)
      • 기타 (5)
        • Kafka (3)
        • Kubernetes (3)
        • Docker (13)
        • git (19)
        • 잡동사니 (27)
      • 재테크 (11)
        • 세무 (4)
        • 투자 (3)
        • 보험 (0)
      • BlockChain (2)
        • BitCoin (0)
      • C (32)
        • C (10)
        • C++ (17)
        • Error (3)
      • Low Level (8)
        • OS (3)
        • 시스템 보안 (5)
      • 네트워크 (3)
      • LINUX (30)
        • Linux (26)
        • Error (4)
      • 저작권과 스마트폰의 이해 (0)
      • 생각 뭉치 (6)
      • 궁금증 (2)
      • Private (4)
        • 이직 경험 (0)
        • 꿈을 찾아서 (1)
      • Android (21)
        • OS (4)
  • 블로그 메뉴

    • 홈
    • WEB
    • 알고리즘
    • DataBase
    • Linux
    • Mobile
    • C
    • 방명록
  • 링크

    • github
  • 공지사항

  • 인기 글

  • 태그

    docker
    JPA
    Programmers
    C++
    javascript
    PostgreSQL
    Kotlin
    백준
    Spring
    Git
    ubuntu
    android
    linux
    kafka
    알고리즘
    프로그래머스
    Bitcoin
    algorithm
    database
    java
  • hELLO· Designed By정상우.v4.10.3
M_Falcon
[PostgreSQL] CHECK Constraint
상단으로

티스토리툴바