Database
[PostgreSQL] 테이블 컬럼 생성, 수정, 삭제하기(column)
JAEEE
2023. 5. 26. 15:44
※윈도우 10 64bit, PostgreSQL Version 15.3, DBeaver 기준으로 작성된 글입니다.※
컬럼 생성
alter table 테이블명 add 컬럼명 데이터타입;
alter table user_table add id integer;

컬럼 수정
alter table 테이블명 rename column 컬럼명 to 새로운 컬럼명;
alter table user_table rename column age to phone_number;

컬럼 삭제
alter table 테이블명 drop column 컬럼명;
alter table user_table drop column phone_number;
