Changes between Version 1 and Version 2 of v6/pgsummary
- Timestamp:
- 04/11/2012 04:48:52 PM (14 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
v6/pgsummary
v1 v2 73 73 SELECT * FROM source; 74 74 }}} 75 == 导数据 == 76 * 字符长度超长 77 {{{ 78 [postgres@test740-10 ora2cyp]$ cat export.log |grep ERROR 79 psql:ENT_COMPANY_WEB.sql:142: ERROR: value too long for type character varying(720) 80 psql:ENT_NEWS_WEB.sql:19: ERROR: value too long for type character varying(500) 81 数据长度不对,有可能跟转为utf8 字符集,长度增加有关系,奇怪的是其他表不需要。 82 83 psql:ENT_QQ_CONTACT.sql:21: ERROR: bigint out of range 84 其中的qq 号明显有问题,修改字段类型,重新导入,建议开发对输入做限制。 85 86 psql:ENT_QUESTION.sql:1125: ERROR: value too long for type character varying(2000) 87 ENT_REQUEST_ERROR.sql Tue Mar 13 21:19:13 CST 2012 88 psql:ENT_REQUEST_ERROR.sql:43: ERROR: value too long for type character varying(4000) 89 psql:ENT_SYSLOG.sql:72: ERROR: value too long for type character varying(500) 90 91 数据长度不对,有可能跟转为utf8 字符集,长度增加有关系,奇怪的是其他表不需要。 92 }}} 93 * 字符编码问题,部分gbk了里的乱码,没有对应utf8编码,无法转入,需要人工干预。 ( 目前已经解决,请补充细节) 75 94 76 95 == 驱动 == … … 84 103 Long count = (Long)em.createNativeQuery("select count(*) from table").getSingleResult(); 85 104 }}} 105 * like的写法调整 http://bbs.pconline.cn/topic-2071.html 106 {{{ 107 oracle: 108 select * from ENT_CONSTANTS where lower(type) like '%config.%' 109 110 pg: 111 select * from ENT_CONSTANTS where lower(type) like '%config.%' escape '\\' 112 或者 select * from ENT_CONSTANTS where lower(type) like '%config.%' escape E'\\' 113 注意这个E 是pg 里escape 的语法。 这样基本的问题就解决了。 114 或者 select * from ENT_CONSTANTS where type ~* E'config.' 115 116 至少不用对每行都做lower()的函数运算了。 ~ ~* 是pg 里正则表达的运算符 ~* 不区分大小写 117 }}}
![(please configure the [header_logo] section in trac.ini)](http://www1.pconline.com.cn/global/2008/images/jss/m_logo091125.jpg)