ERROR
Hibernate: insert into restaurant (city, detail_address, latitude, longitude, simple_address, state, zipcode, create_datetime, introduction, name, update_datetime, way_to_go) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
2022-08-29 14:06:23.032 WARN 1 --- [nio-8080-exec-6] o.h.engine.jdbc.spi.SqlExceptionHelper : SQL Error: 0, SQLState: 22001
2022-08-29 14:06:23.032 ERROR 1 --- [nio-8080-exec-6] o.h.engine.jdbc.spi.SqlExceptionHelper : ERROR: value too long for type character varying(70)
2022-08-29 14:06:23.037 ERROR 1 --- [nio-8080-exec-6] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.springframework.dao.DataIntegrityViolationException: could not execute statement; SQL [n/a]; nested exception is org.hibernate.exception.DataException: could not execute statement] with root cause
org.postgresql.util.PSQLException: ERROR: value too long for type character varying(70)
SQL
복사
•
컬럼 문자열 보다 큰 값이 들어오는 경우 문장 에러 발생
•
맛집 소개글로 사용 되기 때문에 컬럼 제한 수정
ALTER TABLE public.restaurant ALTER COLUMN introduction TYPE varchar(1000) USING introduction::varchar;
SQL
복사