value too long for type character varying(3000)

一、先看error日志

Caused By: org.hibernate.exception.DataException:Could not execute JDBC batch update

Caused By:java.sql.BatchUPdateExcetion:batch entry 0 insert into 表(字段) values (值)was aborted:error :value too long for type character varying(3000) Call getNextException to see other errors in the

batchCaused By:o r g.postgresql.util.PSQLExcetion:ERROR:value too long for type character varying(3000)

二、问题描述

数据库字段长度是3000,录入的富文本是网页中粘贴入的样式,文字长度如下图:

但是没有达到3000,却报错超长

三、原因分析

分析是因为该段文本是网页粘贴到word的,里面有样式等导致超长,单独文本插入是没有问题的

 

那就 单独文本插入