#13 PostgreSQL
#13.3 PostgreSQL Data Types
CREATE TYPE gender_type AS ENUM ('male', 'femalle');
CREATE TABLE users (
-- 0 < char(n) varchar(n) < 10,485,760
username CHAR(10) NOT NULL UNIQUE,
email VARCHAR(50) NOT NULL UNIQUE,
gender gender_type NOT NULL,
interest TEXT[] NOT NULL, -- TEXT로 된 리스트 > 좋은 방법은 아님
-- TEXT 1GB가 최대, > 2KB 다른 테이블로 옮겨지고 주소만 저장 TOAST (the oversized-attribute storage technique)
bio TEXT,
profile_photo BYTEA
)#13.4 PostgreSQL Data Types part Two
https://www.postgresql.org/docs/16/datatype-geometric.html
#13.5 Type Casting
https://www.postgresql.org/docs/8.1/functions-datetime.html
#13.7 UNNEST
#13.8 FULL OUTER JOIN
Last updated
Was this helpful?