일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
Tags
- 우아한테크코스 2차
- S3
- EC2
- docker-compose
- docker
- github
- python all testcode
- 프로그래머스
- 우아한 테크코스 2차 합격
- 재귀함수가 뭔가요
- github skyline
- depends
- OperationalError
- Django
- springboot 3.0.0
- AWS S3
- Spring
- MySQL server on 'db' (115)
- AWS
- classmethod
- python
- classproperty
- 2차 코딩테스트
- TypeError: 'property' object is not iterable
- javascript
- DB
- 갓재석
- 코딩테스트
- depends_on
- METACLASS
Archives
hanbin.dev
[PSQL] Alter Column Type from UUID to Integer 본문
UUID type의 column을 바로 Integer로 변환하려 하면 에러가 발생한다.
```
ALTER TABLE comment ALTER COLUMN post_id TYPE INTEGER USING post_id::integer;
ERROR: cannot cast type uuid to integer
LINE 1: ...post_id TYPE INTEGER USING post_id::integer;
```
VARCHAR로 한번 변환 시켜준 후, Integer로 변환시키면 된다.
```
ALTER TABLE comment ALTER COLUMN post_id TYPE varchar USING post_id::varchar
ALTER TABLE comment ALTER COLUMN post_id TYPE integer USING post_id::integer
```