콘텐츠로 이동
Search

PostgreSQL:Constraints

제약조건

글자 수 제한

When you create the table you can do something of this sort,

CREATE TABLE names (
  name text CONSTRAINT namechk CHECK (char_length(name) <= 255)
)

(namechk is just a name for the constraint)

Same goes for ALTER TABLE for example:

ALTER TABLE names
  ADD CONSTRAINT namechk CHECK (char_length(name) <= 255);

Check Constraints

on delete cascade

on update cascade

See also

Favorite site

lastmod 2024-02-22created 2024-02-22author Zer0 sitemap