Changes between Version 1 and Version 2 of v6/pgsummary


Ignore:
Timestamp:
04/11/2012 04:48:52 PM (14 years ago)
Author:
chenchongqi
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • v6/pgsummary

    v1 v2  
    7373SELECT * FROM source; 
    7474}}} 
     75== 导数据 == 
     76* 字符长度超长 
     77{{{ 
     78[postgres@test740-10 ora2cyp]$ cat export.log |grep ERROR 
     79psql:ENT_COMPANY_WEB.sql:142: ERROR: value too long for type character varying(720) 
     80psql:ENT_NEWS_WEB.sql:19: ERROR: value too long for type character varying(500) 
     81数据长度不对,有可能跟转为utf8 字符集,长度增加有关系,奇怪的是其他表不需要。 
     82 
     83psql:ENT_QQ_CONTACT.sql:21: ERROR: bigint out of range 
     84其中的qq 号明显有问题,修改字段类型,重新导入,建议开发对输入做限制。 
     85 
     86psql:ENT_QUESTION.sql:1125: ERROR: value too long for type character varying(2000) 
     87ENT_REQUEST_ERROR.sql Tue Mar 13 21:19:13 CST 2012 
     88psql:ENT_REQUEST_ERROR.sql:43: ERROR: value too long for type character varying(4000) 
     89psql:ENT_SYSLOG.sql:72: ERROR: value too long for type character varying(500) 
     90 
     91数据长度不对,有可能跟转为utf8 字符集,长度增加有关系,奇怪的是其他表不需要。 
     92}}} 
     93* 字符编码问题,部分gbk了里的乱码,没有对应utf8编码,无法转入,需要人工干预。 ( 目前已经解决,请补充细节)  
    7594 
    7695== 驱动 == 
     
    84103Long count = (Long)em.createNativeQuery("select count(*) from table").getSingleResult(); 
    85104}}} 
     105* like的写法调整 http://bbs.pconline.cn/topic-2071.html 
     106{{{ 
     107oracle: 
     108select * from ENT_CONSTANTS where lower(type) like '%config.%' 
     109 
     110pg: 
     111select * 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}}}