728x90
SMALL
integer형인 컬럼을 character varying로 변경을 했다
table명 : project
컬럼명 : time
ALTER TABLE project ALTER COLUMN time TYPE character varying;
이건 수월하게 완료가 됐다
근데 반대로 문자형을 integer형으로 변환하려고 똑같이 썼는데 에러가 나는거다
ALTER TABLE project ALTER COLUMN time TYPE integer;
ERROR: column "time" cannot be cast automatically to type integer
HINT: You might need to specify "USING time::integer".
정말 알다가도 모를 콤퓨타의 세계
텍스트에서 정수형으로 자동변환은 지원하지 않는다네 ㅋ... 좀 해주지;;
ALTER TABLE project ALTER COLUMN time TYPE integer USING time::integer;
그래서 이렇게 써주니 ./. 뭐 완료.....
728x90
LIST
'DB > Postgresql' 카테고리의 다른 글
통계 최종쿼리 (0) | 2021.11.11 |
---|---|
코드 매핑작업; a_code에 해당하는 b_code를 매핑테이블을 활용해 넣어주기 (0) | 2021.11.10 |
[Postgresql] 외부접속 허용하기, unable to connect to server (0) | 2021.07.27 |
[postgresql] 시퀀스 현재값 확인하기 (0) | 2021.07.12 |
postgresql 컬럼변경 (0) | 2021.06.30 |
댓글