E:\HS\LightDBSVN\23.3sql文件\迁移工具\caofa\config\application.properties
gbk-->uft8:
logging.config=classpath:log4j2.xml
# ????
etl.global.sourceDatabase=oracle
etl.global.targetDatabase=lightdb
etl.global.showSql=false
etl.global.fastFail=false
etl.global.enableWithDoubleQuote=false
etl.global.package.onlyKeepType=true
etl.global.transferSchemas=hr
etl.global.enableFunctions=TransferTable,TransferTableData,TableCompare,TableDataCompare,TransferIndex,TransferSequence,TransferView,TransferTrigger,TransferPackage,TransferProcedure,TransferFunction#gbketl.source.jdbc.url=jdbc:oracle:thin:@10.20.30.199:1521/gbk
etl.source.jdbc.username=test
etl.source.jdbc.password=test# utf8
etl.target.jdbc.url=jdbc:postgresql://10.19.69.252:5432/etlu2
etl.target.jdbc.username=lightdb
etl.target.jdbc.password=lightdb123
-- 创建表
drop TABLE hr.gbk2;
CREATE TABLE hr.gbk2 ( id NUMBER PRIMARY KEY, data VARCHAR2(4000)
); INSERT INTO hr.gbk2 (id, data) VALUES (1, 'fhsjdhfjs看到回國的飛機共和黨國會');
INSERT INTO hr.gbk2 (id, data) VALUES (2, '付款的官方的理工科 ');
INSERT INTO hr.gbk2 (id, data) VALUES (3, '看來是價格 ');
INSERT INTO hr.gbk2 (id, data) VALUES (4, '快攻打法瞭解更多 ');
INSERT INTO hr.gbk2 (id, data) VALUES (5, '84375jkdgkfckvkb堅不可摧v ');
INSERT INTO hr.gbk2 (id, data) VALUES (6, ';報價參考報價下 ');
INSERT INTO hr.gbk2 (id, data) VALUES (7, '老闆超級不開心 ');
INSERT INTO hr.gbk2 (id, data) VALUES (8, '了從包括v菠蘿快車v了 ');
INSERT INTO hr.gbk2 (id, data) VALUES (9, '从离开滨江屡见不鲜 ');
INSERT INTO hr.gbk2 (id, data) VALUES (10, '查看背景下来不及 差旅不可撤销吧');
INSERT INTO hr.gbk2 (id, data) VALUES (11, 'clvjbxj ');
INSERT INTO hr.gbk2 (id, data) VALUES (12, '了出现崩溃');
INSERT INTO hr.gbk2 (id, data) VALUES (13, '查看下礼拜');
commit;select * from hr.gbk2;
插入自定义字符:
# 通过unicode插入不存在gbk unicode_char4 = u'\ue000'
insert_sql = """ INSERT INTO hr.gbk2 (id, data) VALUES (:id1,:value) """
cursor.execute(insert_sql, {'id1':36,'value': unicode_char4}) cursor.execute(insert_sql, {'id1':37,'value': unicode_char4})
迁移后查看lightdb-x:
lightdb@etlu2=# drop table hr.gbk2;
DROP TABLE
lightdb@etlu2=# select * from hr.gbk2;
ERROR: relation "hr.gbk2" does not exist
LINE 1: select * from hr.gbk2;^
lightdb@etlu2=# select * from hr.gbk2;id | data
----+-----------------------------------37 | 1 | fhsjdhfjs看到回國的飛機共和黨國會2 | 付款的官方的理工科 3 | 看來是價格 4 | 快攻打法瞭解更多 5 | 84375jkdgkfckvkb堅不可摧v 6 | ;報價參考報價下 7 | 老闆超級不開心 8 | 了從包括v菠蘿快車v了 9 | 从离开滨江屡见不鲜 10 | 查看背景下来不及 差旅不可撤销吧11 | clvjbxj 12 | 了出现崩溃13 | 查看下礼拜36 |
(15 rows)lightdb@etlu2=# show server_encoding ;server_encoding
-----------------UTF8
(1 row)lightdb@etlu2=#
2023-09-27 17:50:38.276 [main] INFO com.hundsun.lightdb.core.EtlDirector - 表结构对比开始
2023-09-27 17:50:38.277 [main] INFO com.hundsun.lightdb.core.EtlDirector - hr.countries对比一致。hr.regions对比一致。hr.gbk2对比一致。hr.gbktest对比一致。
数据比对一致:
2023-09-27 17:50:38.795 [main] INFO com.hundsun.lightdb.core.EtlDirector - 数据对比开始
regions对比一致。countries对比一致。job_history对比一致。locations对比一致。gbk2对比一致。jobs对比一致。employees对比一致。departments对比一致。
gbk--->gbk:数据迁移报错
[lightdb@lightdb1 lightdb-x-13.8-23.3-14917-el7.x86_64]$ /data2/xjh/auto/lightdb-x/13.8-23.3/bin/ltsql -p 5444
ltsql (13.8-23.3)
compatible type: postgresql
Type "help" for help.lightdb@postgres=# \lList of databasesName | Owner | Encoding | Collate | Ctype | Access privileges
-----------+---------+----------+-----------+-----------+---------------------etl | lightdb | GBK | zh_CN.gbk | zh_CN.gbk | =Tc/lightdb +| | | | | lightdb=CTc/lightdb+| | | | | etl=CTc/lightdbetl_gbk | lightdb | GBK | zh_CN.gbk | zh_CN.gbk | =Tc/lightdb +| | | | | lightdb=CTc/lightdb+| | | | | etl_gbk=CTc/lightdblt_test | lightdb | GBK | zh_CN.gbk | zh_CN.gbk | postgres | lightdb | GBK | zh_CN.gbk | zh_CN.gbk | template0 | lightdb | GBK | zh_CN.gbk | zh_CN.gbk | =c/lightdb +| | | | | lightdb=CTc/lightdbtemplate1 | lightdb | GBK | zh_CN.gbk | zh_CN.gbk | =c/lightdb +| | | | | lightdb=CTc/lightdb
(6 rows)lightdb@postgres=# \c etl_gbk;
You are now connected to database "etl_gbk" as user "lightdb".
compatible type: oracle
lightdb@etl_gbk=# show server_encoding ;server_encoding
-----------------GBK
(1 row)lightdb@etl_gbk=#
修改迁移工具配置:
# gbk
etl.target.jdbc.url=jdbc:postgresql://10.19.69.252:5444/etl_gbk
etl.target.jdbc.username=lightdb
etl.target.jdbc.password=lightdb123
数据迁移报错:
lightdb@etl_gbk=# select * from hr.gbk2;
id | data
----+------
(0 rows)
lightdb@etl_gbk=#
2023-09-28 15:59:09.234 [pool-4-thread-1] INFO com.hundsun.lightdb.ImportWorker - begin data transmission for table [ hr.gbk2 ]
2023-09-28 15:59:09.235 [pool-3-thread-1] ERROR com.hundsun.lightdb.core.EtlGlobalCtx - 信息: error data transmission for table hr.case_test 堆栈:java.lang.RuntimeException: java.sql.SQLSyntaxErrorException: ORA-00904: "AAAA": 标识符无效at com.hundsun.lightdb.JdbcUtils.doQuery(JdbcUtils.java:33)at com.hundsun.lightdb.ImportWorker.run(ImportWorker.java:43)at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.sql.SQLSyntaxErrorException: ORA-00904: "AAAA": 标识符无效at oracle.jdbc.driver.T4CTTIoer11.processError(T4CTTIoer11.java:509)at oracle.jdbc.driver.T4CTTIoer11.processError(T4CTTIoer11.java:461)at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:1104)at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:550)at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:268)at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:655)at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:229)at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:41)at oracle.jdbc.driver.T4CStatement.executeForDescribe(T4CStatement.java:765)at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:983)at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1168)at oracle.jdbc.driver.OracleStatement.executeQuery(OracleStatement.java:1362)at oracle.jdbc.driver.OracleStatementWrapper.executeQuery(OracleStatementWrapper.java:369)at com.hundsun.lightdb.JdbcUtils.doQuery(JdbcUtils.java:30)... 6 more
Caused by: Error : 904, Position : 16, Sql = SELECT a,aa,aaa,aaaa from hr.case_test , OriginalSql = SELECT a,aa,aaa,aaaa from hr.case_test , Error Msg = ORA-00904: "AAAA": 标识符无效at oracle.jdbc.driver.T4CTTIoer11.processError(T4CTTIoer11.java:513)... 19 more2023-09-28 15:59:09.236 [pool-3-thread-1] INFO com.hundsun.lightdb.ImportWorker - begin data transmission for table [ hr.sales_orders1 ]
2023-09-28 15:59:09.243 [pool-3-thread-1] INFO com.hundsun.lightdb.ImportWorker - end transfer table [hr.sales_orders1 耗时 0 秒]
2023-09-28 15:59:09.243 [pool-3-thread-1] INFO com.hundsun.lightdb.ImportWorker - begin data transmission for table [ hr.xjh_number10 ]
2023-09-28 15:59:09.254 [pool-3-thread-1] INFO com.hundsun.lightdb.ImportWorker - end transfer table [hr.xjh_number10 耗时 0 秒]
2023-09-28 15:59:09.254 [pool-4-thread-1] ERROR com.hundsun.lightdb.core.EtlGlobalCtx - 信息: error data transmission for table gbk2 堆栈:java.sql.BatchUpdateException: Batch entry 0 insert into hr.gbk2 (id,data) values ('36'::numeric,'') was aborted: ERROR: character with byte sequence 0xee 0x80 0x80 in encoding "UTF8" has no equivalent in encoding "GBK" Call getNextException to see other errors in the batch.at org.postgresql.jdbc.BatchResultHandler.handleError(zj:182)at org.postgresql.core.v3.QueryExecutorImpl.processResults(le:3125)at org.postgresql.core.v3.QueryExecutorImpl.execute(le:659)at org.postgresql.jdbc.PgStatement.ALLATORIxDEMO(tl:1763)at org.postgresql.jdbc.PgStatement.executeBatch(tl:1641)at org.postgresql.jdbc.PgPreparedStatement.executeBatch(fj:1540)at com.hundsun.lightdb.ImportWorker.lambda$run$0(ImportWorker.java:75)at com.hundsun.lightdb.JdbcUtils.doQuery(JdbcUtils.java:31)at com.hundsun.lightdb.ImportWorker.run(ImportWorker.java:43)at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: org.postgresql.util.PSQLException: ERROR: character with byte sequence 0xee 0x80 0x80 in encoding "UTF8" has no equivalent in encoding "GBK"at org.postgresql.core.v3.QueryExecutorImpl.ALLATORIxDEMO(le:3279)at org.postgresql.core.v3.QueryExecutorImpl.processResults(le:1889)... 12 more2023-09-28 15:59:09.254 [pool-3-thread-1] INFO com.hundsun.lightdb.ImportWorker - begin data transmission for table [ hr.departments ]
2023-09-28 15:59:09.254 [pool-4-thread-1] INFO com.hundsun.lightdb.ImportWorker - end transfer table [hr.gbk2 耗时 0 秒]
2023-09-28 15:59:09.262 [pool-4-thread-1] INFO com.hundsun.lightdb.ImportWorker - begin data transmission for table [ hr.special_orders1 ]
2023-09-28 15:59:09.274 [pool-4-thread-1] INFO com.hundsun.lightdb.ImportWorker - end transfer table [hr.special_orders1 耗时 0 秒]
2023-09-28 15:59:09.275 [pool-4-thread-1] INFO com.hundsun.lightdb.ImportWorker - begin data transmission for table [ hr.medium_orders1 ]
2023-09-28 15:59:09.282 [pool-4-thread-1] INFO com.hundsun.lightdb.ImportWorker - end transfer table [hr.medium_orders1 耗时 0 秒]
2023-09-28 15:59:09.282 [pool-3-thread-1] WARN com.hundsun.lightdb.core.EtlGlobalCtx - 关系已存在 堆栈:java.sql.BatchUpdateException: Batch entry 0 insert into hr.departments (department_id,department_name,manager_id,location_id) values ('10'::numeric,'Administration','200'::numeric,'1700'::numeric) was aborted: ERROR: duplicate key value violates unique constraint "dept_id_pk"详细:Key (department_id)=(10) already exists. Call getNextException to see other errors in the batch.at org.postgresql.jdbc.BatchResultHandler.handleError(zj:182)at org.postgresql.core.v3.QueryExecutorImpl.processResults(le:3125)at org.postgresql.core.v3.QueryExecutorImpl.execute(le:659)at org.postgresql.jdbc.PgStatement.ALLATORIxDEMO(tl:1763)at org.postgresql.jdbc.PgStatement.executeBatch(tl:1641)at org.postgresql.jdbc.PgPreparedStatement.executeBatch(fj:1540)at com.hundsun.lightdb.ImportWorker.lambda$run$0(ImportWorker.java:75)at com.hundsun.lightdb.JdbcUtils.doQuery(JdbcUtils.java:31)at com.hundsun.lightdb.ImportWorker.run(ImportWorker.java:43)at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint "dept_id_pk"详细:Key (department_id)=(10) already exists.at org.postgresql.core.v3.QueryExecutorImpl.ALLATORIxDEMO(le:3279)at org.postgresql.core.v3.QueryExecutorImpl.processResults(le:1889)... 12 more2023-09-28 15:59:09.282 [pool-4-thread-1] INFO com.hundsun.lightdb.ImportWorker - begin data transmission for table [ hr.haha ]
2023-09-28 15:59:09.282 [pool-3-thread-1] INFO com.hundsun.lightdb.ImportWorker - end transfer table [hr.departments 耗时 0 秒]
2023-09-28 15:59:09.291 [pool-4-thread-1] INFO com.hundsun.lightdb.ImportWorker - end transfer table [hr.haha 耗时 0 秒]
2023-09-28 15:59:09.291 [pool-3-thread-1] INFO com.hundsun.lightdb.ImportWorker - begin data transmission for table [ hr.a ]
2023-09-28 15:59:09.292 [pool-4-thread-1] INFO com.hundsun.lightdb.ImportWorker - begin data transmission for table [ hr.job_history ]
2023-09-28 15:59:09.310 [pool-3-thread-1] INFO com.hundsun.lightdb.ImportWorker - executed batch hr.a 4
2023-09-28 15:59:09.310 [pool-3-thread-1] INFO com.hundsun.lightdb.ImportWorker - end transfer table [hr.a 耗时 0 秒]
2023-09-28 15:59:09.310 [pool-4-thread-1] WARN com.hundsun.lightdb.core.EtlGlobalCtx - 关系已存在 堆栈:java.sql.BatchUpdateException: Batch entry 0 insert into hr.job_history (employee_id,start_date,end_date,job_id,department_id) values ('102'::numeric,'2001-01-13 00:00:00+08','2006-07-24 00:00:00+08','IT_PROG','60'::numeric) was aborted: ERROR: duplicate key value violates unique constraint "jhist_emp_id_st_date_pk"详细:Key (employee_id, start_date)=(102, 2001-01-13 00:00:00) already exists. Call getNextException to see other errors in the batch.at org.postgresql.jdbc.BatchResultHandler.handleError(zj:182)at org.postgresql.core.v3.QueryExecutorImpl.processResults(le:3125)at org.postgresql.core.v3.QueryExecutorImpl.execute(le:659)at org.postgresql.jdbc.PgStatement.ALLATORIxDEMO(tl:1763)at org.postgresql.jdbc.PgStatement.executeBatch(tl:1641)at org.postgresql.jdbc.PgPreparedStatement.executeBatch(fj:1540)at com.hundsun.lightdb.ImportWorker.lambda$run$0(ImportWorker.java:75)at com.hundsun.lightdb.JdbcUtils.doQuery(JdbcUtils.java:31)at com.hundsun.lightdb.ImportWorker.run(ImportWorker.java:43)at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint "jhist_emp_id_st_date_pk"详细:Key (employee_id, start_date)=(102, 2001-01-13 00:00:00) already exists.at org.postgresql.core.v3.QueryExecutorImpl.ALLATORIxDEMO(le:3279)at org.postgresql.core.v3.QueryExecutorImpl.processResults(le:1889)... 12 more2023-09-28 15:59:09.310 [pool-4-thread-1] INFO com.hundsun.lightdb.ImportWorker - end transfer table [hr.job_history 耗时 0 秒]
2023-09-28 15:59:09.314 [pool-4-thread-1] INFO com.hundsun.lightdb.ImportWorker - begin data transmission for table [ hr.test ]
2023-09-28 15:59:08.905 [main] INFO com.hundsun.lightdb.core.EtlDirector - 表结构对比开始
2023-09-28 15:59:08.909 [main] INFO com.hundsun.lightdb.core.EtlDirector - hr.gbk2对比一致。....
2023-09-28 15:59:10.177 [main] INFO com.hundsun.lightdb.core.EtlDirector - 数据对比开始gbk2结果不一致 目标:无数据
...
uft8-->gbk:报错
#utf-8
etl.source.jdbc.url=jdbc:oracle:thin:@10.20.30.199:1521/test
etl.source.jdbc.username=hr
etl.source.jdbc.password=hr# gbk
etl.target.jdbc.url=jdbc:postgresql://10.19.69.252:5444/etl_gbk
etl.target.jdbc.username=lightdb
etl.target.jdbc.password=lightdb123
表结构迁移成功,数据迁移失败。
2023-09-27 18:11:15.664 [pool-7-thread-1] INFO com.hundsun.lightdb.ImportWorker - end transfer table [hr.xjh_example_table3 耗时 0 秒]
2023-09-27 18:11:15.664 [pool-4-thread-1] ERROR com.hundsun.lightdb.core.EtlGlobalCtx - 信息: error data transmission for table gbk2 堆栈:java.sql.BatchUpdateException: Batch entry 0 insert into hr.gbk2 (id,data) values ('36'::numeric,'') was aborted: ERROR: character with byte sequence 0xee 0x80 0x80 in encoding "UTF8" has no equivalent in encoding "GBK" Call getNextException to see other errors in the batch.at org.postgresql.jdbc.BatchResultHandler.handleError(zj:182)at org.postgresql.core.v3.QueryExecutorImpl.processResults(le:3125)at org.postgresql.core.v3.QueryExecutorImpl.execute(le:659)at org.postgresql.jdbc.PgStatement.ALLATORIxDEMO(tl:1763)at org.postgresql.jdbc.PgStatement.executeBatch(tl:1641)at org.postgresql.jdbc.PgPreparedStatement.executeBatch(fj:1540)at com.hundsun.lightdb.ImportWorker.lambda$run$0(ImportWorker.java:75)at com.hundsun.lightdb.JdbcUtils.doQuery(JdbcUtils.java:31)at com.hundsun.lightdb.ImportWorker.run(ImportWorker.java:43)at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: org.postgresql.util.PSQLException: ERROR: character with byte sequence 0xee 0x80 0x80 in encoding "UTF8" has no equivalent in encoding "GBK"at org.postgresql.core.v3.QueryExecutorImpl.ALLATORIxDEMO(le:3279)at org.postgresql.core.v3.QueryExecutorImpl.processResults(le:1889)... 12 more2023-09-27 18:11:15.664 [pool-7-thread-1] INFO com.hundsun.lightdb.ImportWorker - begin data transmission for table [ hr.employee_data ]
2023-09-27 18:11:15.666 [pool-4-thread-1] INFO com.hundsun.lightdb.ImportWorker - end transfer table [hr.gbk2 耗时 0 秒]
uft8迁移到utf8:
#utf-8
etl.source.jdbc.url=jdbc:oracle:thin:@10.20.30.199:1521/test
etl.source.jdbc.username=hr
etl.source.jdbc.password=hr# utf8
etl.target.jdbc.url=jdbc:postgresql://10.19.69.252:5432/etlu2
etl.target.jdbc.username=lightdb
etl.target.jdbc.password=lightdb123
[lightdb@lightdb1 lightdb-x-13.8-23.3-14917-el7.x86_64]$ /data2/xjh/auto/lightdb-x/13.8-23.3/bin/ltsql -p 5432
ltsql (13.8-23.3)
compatible type: postgresql
Type "help" for help.lightdb@postgres=# \c etlu2
You are now connected to database "etlu2" as user "lightdb".
compatible type: oracle
lightdb@etlu2=# show port;port
------5432
(1 row)lightdb@etlu2=# show server_encoding ;server_encoding
-----------------UTF8
(1 row)lightdb@etlu2=# select * from hr.gbk2;id | data
----+-----------------------------------37 | 1 | fhsjdhfjs看到回國的飛機共和黨國會2 | 付款的官方的理工科 3 | 看來是價格 4 | 快攻打法瞭解更多 5 | 84375jkdgkfckvkb堅不可摧v 6 | ;報價參考報價下 7 | 老闆超級不開心 8 | 了從包括v菠蘿快車v了 9 | 从离开滨江屡见不鲜 10 | 查看背景下来不及 差旅不可撤销吧11 | clvjbxj 12 | 了出现崩溃13 | 查看下礼拜36 |
(15 rows)lightdb@etlu2=# drop table hr.gbk2;
DROP TABLE
lightdb@etlu2=#
迁移数据成功:
lightdb@etlu2=# select * from hr.gbk2;id | data
----+-----------------------------------36 | 37 | 1 | fhsjdhfjs看到回國的飛機共和黨國會2 | 付款的官方的理工科 3 | 看來是價格 4 | 快攻打法瞭解更多 5 | 84375jkdgkfckvkb堅不可摧v 6 | ;報價參考報價下 7 | 老闆超級不開心 8 | 了從包括v菠蘿快車v了 9 | 从离开滨江屡见不鲜 10 | 查看背景下来不及 差旅不可撤销吧11 | clvjbxj 12 | 了出现崩溃13 | 查看下礼拜
(15 rows)lightdb@etlu2=#
需要通过lt_initdb 指定Gb18030新建一个数据库
# gbk Gb18030 gb18030test
etl.target.jdbc.url=jdbc:postgresql://10.20.30.199:8867/gb18030test
etl.target.jdbc.username=lightdb
etl.target.jdbc.password=lightdb123
lightdb@gb18030test=# SELECT pg_encoding_to_char(encoding) FROM pg_database WHERE datname = 'gb18030test';
pg_encoding_to_char
---------------------
GB18030
(1 row)
lightdb@gb18030test=#
lightdb从gb18030->utf8 导入导出测试,数据为空,但行数没少:
lt_dump -Fp -f gb18030test_0928_2.sql -c -C -E GB18030 -h 10.20.30.199 -d gb18030test -p 8867
[lightdb@hs-10-20-30-199 xjh]$ lt_dump -Fp -f gb18030test_0928_2.sql -c -C -E GB18030 -h 10.20.30.199 -d gb18030test -p 8867
lt_dump: NOTICE: zhparser add dict : "/home/lightdb/yc/data18030/base/25060/zhprs_dict_gb18030test.txt" failed! if zhparser version is 2.0, then just ignore
[lightdb@hs-10-20-30-199 xjh]$
[lightdb@lightdb1 xjh]$ rz[lightdb@lightdb1 xjh]$ /data2/xjh/auto/lightdb-x/13.8-23.3/bin/ltsql -p 5432 utf_0928<gb18030test_0928_2.sql
SET
SET
SET
SET
SETset_config
------------lt_catalog
(1 row)SET
SET
...
COMMENT
CREATE EXTENSION
COMMENT
CREATE DOMAIN
ALTER DOMAIN
CREATE TYPE
ALTER TYPE
ALTER TYPECREATE TYPE
ALTER TYPE
CREATE DOMAIN
ALTER DOMAIN
CREATE TEXT SEARCH CONFIGURATION
ALTER TEXT SEARCH CONFIGURATION
ALTER TEXT SEARCH CONFIGURATION
ALTER TEXT SEARCH CONFIGURATION
ALTER TEXT SEARCH CONFIGURATION
ALTER TEXT SEARCH CONFIGURATION
ALTER TEXT SEARCH CONFIGURATION
ALTER TEXT SEARCH CONFIGURATION
SET
SET
CREATE TABLE
ALTER TABLECREATE SEQUENCE
ALTER TABLE
CREATE TABLE
ALTER TABLECREATE TABLE
ALTER TABLECREATE SEQUENCE
ALTER TABLE
CREATE SEQUENCE
ALTER TABLE
CREATE SEQUENCE
ALTER TABLE
CREATE SEQUENCE
ALTER TABLE
CREATE SEQUENCE
ALTER TABLE
CREATE SEQUENCE
ALTER TABLECOPY 0COPY 27
COPY 4
COPY 3
COPY 12
COPY 4
COPY 107
COPY 15setval
--------100
(1 row)setval
--------142
(1 row)setval
--------4
(1 row)ALTER TABLE
ALTER TABLECREATE INDEX
CREATE INDEX
...ALTER TABLE
ALTER TABLE
GRANT
[lightdb@lightdb1 xjh]$ ltsql -p 5432
ltsql (13.8-23.3)
compatible type: postgresql
Type "help" for help.lightdb@postgres=# \c gb18030test
You are now connected to database "gb18030test" as user "lightdb".
compatible type: postgresql
lightdb@gb18030test=# select * from hr.gbk2;id | data
----+-----------------------------------36 | 37 | 1 | fhsjdhfjs看到回國的飛機共和黨國會2 | 付款的官方的理工科 3 | 看來是價格 4 | 快攻打法瞭解更多 5 | 84375jkdgkfckvkb堅不可摧v 6 | ;報價參考報價下 7 | 老闆超級不開心 8 | 了從包括v菠蘿快車v了 9 | 从离开滨江屡见不鲜 10 | 查看背景下来不及 差旅不可撤销吧11 | clvjbxj 12 | 了出现崩溃13 | 查看下礼拜
(15 rows)lightdb@gb18030test=#
lightdb从gb18030->gbk 导入导出测试,数据为空,但行数没少:
/data2/xjh/auto/lightdb-x/13.8-23.3/bin/ltsql -p 5444 postgres<gb18030test_0928_2.sql
[lightdb@lightdb1 xjh]$ ltsql -p5444
ltsql (13.8-23.3)
compatible type: postgresql
Type "help" for help.lightdb@postgres=# \lList of databasesName | Owner | Encoding | Collate | Ctype | Access privileges
-----------+---------+----------+-----------+-----------+---------------------etl | lightdb | GBK | zh_CN.gbk | zh_CN.gbk | =Tc/lightdb +| | | | | lightdb=CTc/lightdb+| | | | | etl=CTc/lightdbetl_gbk | lightdb | GBK | zh_CN.gbk | zh_CN.gbk | =Tc/lightdb +| | | | | lightdb=CTc/lightdb+| | | | | etl_gbk=CTc/lightdblt_test | lightdb | GBK | zh_CN.gbk | zh_CN.gbk | postgres | lightdb | GBK | zh_CN.gbk | zh_CN.gbk | template0 | lightdb | GBK | zh_CN.gbk | zh_CN.gbk | =c/lightdb +| | | | | lightdb=CTc/lightdbtemplate1 | lightdb | GBK | zh_CN.gbk | zh_CN.gbk | =c/lightdb +| | | | | lightdb=CTc/lightdb
(6 rows)lightdb@postgres=# \q
[lightdb@lightdb1 xjh]$ ll
total 2007800
drwxrwxr-x 2 lightdb lightdb 4096 Jun 26 17:49 11
drwxrwxr-x 3 lightdb lightdb 4096 Sep 21 16:06 agent
drwxrwxr-x 5 lightdb lightdb 4096 Sep 21 14:14 auto
drwxrwxr-x 5 lightdb lightdb 4096 Sep 20 11:30 etl
-rw-r--r-- 1 lightdb lightdb 502434 Sep 28 17:27 gb18030test_0928_2.sql
-rw-r--r-- 1 lightdb lightdb 527220 Sep 28 17:21 gb18030test_0928.sql
drwxrwxr-x 5 lightdb lightdb 4096 Sep 27 13:26 gbk
-rw-r--r-- 1 lightdb lightdb 69970746 May 23 15:53 lightadb-20230523.tar.gz
-rw-r--r-- 1 lightdb lightdb 448786669 Sep 21 13:34 LightDB1.0-agent-V202303-00-000-el7-x86_64.zip
drwxrwxr-x 7 lightdb lightdb 4096 Sep 20 14:25 LightDB1.0-em-V202303-00-000-el7-x86_64
-rw-r--r-- 1 lightdb lightdb 867927293 Sep 21 13:35 LightDB1.0-em-V202303-00-000-el7-x86_64.zip
-rw-r--r-- 1 lightdb lightdb 668196921 Sep 21 13:33 LightDB1.0-x-V202303-00-000-el7-x86_64.zip
drwxrwxr-x 9 lightdb lightdb 4096 May 16 10:43 lightdb-a-stage
drwxrwxr-x 7 lightdb lightdb 4096 Sep 21 14:13 lightdb-x-13.8-23.3-14917-el7.x86_64
drwxrwxr-x 3 lightdb lightdb 4096 Apr 23 13:19 myfile
drwxr-xr-x 6 root root 4096 Apr 3 19:02 ora2pg
drwxr-xr-x 3 lightdb lightdb 4096 Apr 23 13:19 sql-convert-runtime
-rw-r--r-- 1 lightdb lightdb 918 May 15 13:22 test_prompt.sql
[lightdb@lightdb1 xjh]$ /data2/xjh/auto/lightdb-x/13.8-23.3/bin/ltsql -p 5444 postgres<gb18030test_0928_2.sql
SET
SET
SET
ERROR: invalid value for parameter "client_encoding": "GB18030"
DETAIL: Conversion between GB18030 and GBK is not supported.
SETset_config
------------lt_catalog
(1 row)SET
SET
SET
SET
ERROR: database "gb18030test" does not exist
CREATE DATABASE
ALTER DATABASE
You are now connected to database "gb18030test" as user "lightdb".
compatible type: postgresql
SET
SET
SET
SET
SETset_config
------------lt_catalog
(1 row)SET
SET
SET
SET
CREATE SCHEMA
ALTER SCHEMA
...
CREATE INDEX
CREATE INDEX
ALTER TABLE
ALTER TABLE
GRANT
[lightdb@lightdb1 xjh]$ ltsql -p5444
ltsql (13.8-23.3)
compatible type: postgresql
Type "help" for help.lightdb@postgres=# \lList of databasesName | Owner | Encoding | Collate | Ctype | Access privileges
-------------+---------+----------+---------------+---------------+---------------------etl | lightdb | GBK | zh_CN.gbk | zh_CN.gbk | =Tc/lightdb +| | | | | lightdb=CTc/lightdb+| | | | | etl=CTc/lightdbetl_gbk | lightdb | GBK | zh_CN.gbk | zh_CN.gbk | =Tc/lightdb +| | | | | lightdb=CTc/lightdb+| | | | | etl_gbk=CTc/lightdbgb18030test | lightdb | GB18030 | zh_CN.gb18030 | zh_CN.gb18030 | lt_test | lightdb | GBK | zh_CN.gbk | zh_CN.gbk | postgres | lightdb | GBK | zh_CN.gbk | zh_CN.gbk | template0 | lightdb | GBK | zh_CN.gbk | zh_CN.gbk | =c/lightdb +| | | | | lightdb=CTc/lightdbtemplate1 | lightdb | GBK | zh_CN.gbk | zh_CN.gbk | =c/lightdb +| | | | | lightdb=CTc/lightdb
(7 rows)lightdb@postgres=# \c gb18030test
You are now connected to database "gb18030test" as user "lightdb".
compatible type: postgresql
lightdb@gb18030test=# select * from hr.gbk2;id | data
----+-----------------------------------36 | 37 | 1 | fhsjdhfjs看到回國的飛機共和黨國會2 | 付款的官方的理工科 3 | 看來是價格 4 | 快攻打法瞭解更多 5 | 84375jkdgkfckvkb堅不可摧v 6 | ;報價參考報價下 7 | 老闆超級不開心 8 | 了從包括v菠蘿快車v了 9 | 从离开滨江屡见不鲜 10 | 查看背景下来不及 差旅不可撤销吧11 | clvjbxj 12 | 了出现崩溃13 | 查看下礼拜
(15 rows)lightdb@gb18030test=#
用脚本向pg数据库gb18030test插入一个特殊字符:
# 要插入的Unicode字符 unicode_char4 = u'\ue000'# 执行INSERT语句 cur.execute("INSERT INTO hr.gbk2 (id, data) VALUES (%s, %s)", (38, unicode_char4))
[lightdb@hs-10-20-30-199 xjh]$ ltsql -p8867
ltsql (13.8-23.3)
compatible type: postgresql
Type "help" for help.lightdb@postgres=# \lList of databasesName | Owner | Encoding | Collate | Ctype | Access privileges
-------------+---------+----------+---------------+---------------+---------------------gb18030test | lightdb | GB18030 | zh_CN.gb18030 | zh_CN.gb18030 | lt_test | lightdb | GB18030 | zh_CN.gb18030 | zh_CN.gb18030 | postgres | lightdb | GB18030 | zh_CN.gb18030 | zh_CN.gb18030 | template0 | lightdb | GB18030 | zh_CN.gb18030 | zh_CN.gb18030 | =c/lightdb +| | | | | lightdb=CTc/lightdbtemplate1 | lightdb | GB18030 | zh_CN.gb18030 | zh_CN.gb18030 | =c/lightdb +| | | | | lightdb=CTc/lightdb
(5 rows)lightdb@postgres=# \c gb18030test
You are now connected to database "gb18030test" as user "lightdb".
compatible type: postgresql
lightdb@gb18030test=# select * from hr.gbk2;id | data
----+-----------------------------------36 | 37 | 1 | fhsjdhfjs看到回國的飛機共和黨國會2 | 付款的官方的理工科 3 | 看來是價格 4 | 快攻打法瞭解更多 5 | 84375jkdgkfckvkb堅不可摧v 6 | ;報價參考報價下 7 | 老闆超級不開心 8 | 了從包括v菠蘿快車v了 9 | 从离开滨江屡见不鲜 10 | 查看背景下来不及 差旅不可撤销吧11 | clvjbxj 12 | 了出现崩溃13 | 查看下礼拜38 |
(16 rows)lightdb@gb18030test=#
lt_dump -Fp -f gb18030test_0928_3.sql -c -C -E GB18030 -h 10.20.30.199 -d gb18030test -p 8867
gb18030迁移到GBK:
[lightdb@lightdb1 xjh]$ ltsql -p5444
ltsql (13.8-23.3)
compatible type: postgresql
Type "help" for help.lightdb@postgres=# \lList of databasesName | Owner | Encoding | Collate | Ctype | Access privileges
-------------+---------+----------+---------------+---------------+---------------------etl | lightdb | GBK | zh_CN.gbk | zh_CN.gbk | =Tc/lightdb +| | | | | lightdb=CTc/lightdb+| | | | | etl=CTc/lightdbetl_gbk | lightdb | GBK | zh_CN.gbk | zh_CN.gbk | =Tc/lightdb +| | | | | lightdb=CTc/lightdb+| | | | | etl_gbk=CTc/lightdbgb18030test | lightdb | GB18030 | zh_CN.gb18030 | zh_CN.gb18030 | lt_test | lightdb | GBK | zh_CN.gbk | zh_CN.gbk | postgres | lightdb | GBK | zh_CN.gbk | zh_CN.gbk | template0 | lightdb | GBK | zh_CN.gbk | zh_CN.gbk | =c/lightdb +| | | | | lightdb=CTc/lightdbtemplate1 | lightdb | GBK | zh_CN.gbk | zh_CN.gbk | =c/lightdb +| | | | | lightdb=CTc/lightdb
(7 rows)lightdb@postgres=# \c gb18030test
You are now connected to database "gb18030test" as user "lightdb".
compatible type: postgresql
lightdb@gb18030test=# select * from hr.gbk2;id | data
----+-----------------------------------36 | 37 | 1 | fhsjdhfjs看到回國的飛機共和黨國會2 | 付款的官方的理工科 3 | 看來是價格 4 | 快攻打法瞭解更多 5 | 84375jkdgkfckvkb堅不可摧v 6 | ;報價參考報價下 7 | 老闆超級不開心 8 | 了從包括v菠蘿快車v了 9 | 从离开滨江屡见不鲜 10 | 查看背景下来不及 差旅不可撤销吧11 | clvjbxj 12 | 了出现崩溃13 | 查看下礼拜
(15 rows)lightdb@gb18030test=# \lList of databasesName | Owner | Encoding | Collate | Ctype | Access privileges
-------------+---------+----------+---------------+---------------+---------------------etl | lightdb | GBK | zh_CN.gbk | zh_CN.gbk | =Tc/lightdb +| | | | | lightdb=CTc/lightdb+| | | | | etl=CTc/lightdbetl_gbk | lightdb | GBK | zh_CN.gbk | zh_CN.gbk | =Tc/lightdb +| | | | | lightdb=CTc/lightdb+| | | | | etl_gbk=CTc/lightdbgb18030test | lightdb | GB18030 | zh_CN.gb18030 | zh_CN.gb18030 | lt_test | lightdb | GBK | zh_CN.gbk | zh_CN.gbk | postgres | lightdb | GBK | zh_CN.gbk | zh_CN.gbk | template0 | lightdb | GBK | zh_CN.gbk | zh_CN.gbk | =c/lightdb +| | | | | lightdb=CTc/lightdbtemplate1 | lightdb | GBK | zh_CN.gbk | zh_CN.gbk | =c/lightdb +| | | | | lightdb=CTc/lightdb
(7 rows)lightdb@gb18030test=# \c etl
You are now connected to database "etl" as user "lightdb".
compatible type: oracle
lightdb@etl=# drop database gb18030test;
DROP DATABASE
lightdb@etl=# \q
[lightdb@lightdb1 xjh]$ rz[lightdb@lightdb1 xjh]$
[lightdb@lightdb1 xjh]$
[lightdb@lightdb1 xjh]$ /data2/xjh/auto/lightdb-x/13.8-23.3/bin/ltsql -p 5444 postgres<gb18030test_0928_3.sql
SET
SET
SET
ERROR: invalid value for parameter "client_encoding": "GB18030"
DETAIL: Conversion between GB18030 and GBK is not supported.
SETset_config
------------lt_catalog
(1 row)SET
SET
SET
SET
ERROR: database "gb18030test" does not exist
CREATE DATABASE
ALTER DATABASE
You are now connected to database "gb18030test" as user "lightdb".
compatible type: postgresql
SET
SET
SET
SET
SETset_config
------------lt_catalog
(1 row)ALTER TABLE
ALTER TABLE
GRANT
[lightdb@lightdb1 xjh]$ ltsql -p 5444
ltsql (13.8-23.3)
compatible type: postgresql
Type "help" for help.lightdb@postgres=# \lList of databasesName | Owner | Encoding | Collate | Ctype | Access privileges
-------------+---------+----------+---------------+---------------+---------------------etl | lightdb | GBK | zh_CN.gbk | zh_CN.gbk | =Tc/lightdb +| | | | | lightdb=CTc/lightdb+| | | | | etl=CTc/lightdbetl_gbk | lightdb | GBK | zh_CN.gbk | zh_CN.gbk | =Tc/lightdb +| | | | | lightdb=CTc/lightdb+| | | | | etl_gbk=CTc/lightdbgb18030test | lightdb | GB18030 | zh_CN.gb18030 | zh_CN.gb18030 | lt_test | lightdb | GBK | zh_CN.gbk | zh_CN.gbk | postgres | lightdb | GBK | zh_CN.gbk | zh_CN.gbk | template0 | lightdb | GBK | zh_CN.gbk | zh_CN.gbk | =c/lightdb +| | | | | lightdb=CTc/lightdbtemplate1 | lightdb | GBK | zh_CN.gbk | zh_CN.gbk | =c/lightdb +| | | | | lightdb=CTc/lightdb
(7 rows)lightdb@postgres=# \c gb18030test
You are now connected to database "gb18030test" as user "lightdb".
compatible type: postgresql
lightdb@gb18030test=# select * from hr.gbk2;id | data
----+-----------------------------------36 | 37 | 1 | fhsjdhfjs看到回國的飛機共和黨國會2 | 付款的官方的理工科 3 | 看來是價格 4 | 快攻打法瞭解更多 5 | 84375jkdgkfckvkb堅不可摧v 6 | ;報價參考報價下 7 | 老闆超級不開心 8 | 了從包括v菠蘿快車v了 9 | 从离开滨江屡见不鲜 10 | 查看背景下来不及 差旅不可撤销吧11 | clvjbxj 12 | 了出现崩溃13 | 查看下礼拜38 |
(16 rows)lightdb@gb18030test=#
gb18030迁移到utf8:
/data2/xjh/auto/lightdb-x/13.8-23.3/bin/ltsql -p 5432 utf_0928<gb18030test_0928_3.sql
[lightdb@lightdb1 xjh]$ ll
total 2008292
drwxrwxr-x 2 lightdb lightdb 4096 Jun 26 17:49 11
drwxrwxr-x 3 lightdb lightdb 4096 Sep 21 16:06 agent
drwxrwxr-x 5 lightdb lightdb 4096 Sep 21 14:14 auto
drwxrwxr-x 5 lightdb lightdb 4096 Sep 20 11:30 etl
-rw-r--r-- 1 lightdb lightdb 502434 Sep 28 17:27 gb18030test_0928_2.sql
-rw-r--r-- 1 lightdb lightdb 502440 Sep 28 17:48 gb18030test_0928_3.sql
-rw-r--r-- 1 lightdb lightdb 527220 Sep 28 17:21 gb18030test_0928.sql
drwxrwxr-x 5 lightdb lightdb 4096 Sep 27 13:26 gbk
-rw-r--r-- 1 lightdb lightdb 69970746 May 23 15:53 lightadb-20230523.tar.gz
-rw-r--r-- 1 lightdb lightdb 448786669 Sep 21 13:34 LightDB1.0-agent-V202303-00-000-el7-x86_64.zip
drwxrwxr-x 7 lightdb lightdb 4096 Sep 20 14:25 LightDB1.0-em-V202303-00-000-el7-x86_64
-rw-r--r-- 1 lightdb lightdb 867927293 Sep 21 13:35 LightDB1.0-em-V202303-00-000-el7-x86_64.zip
-rw-r--r-- 1 lightdb lightdb 668196921 Sep 21 13:33 LightDB1.0-x-V202303-00-000-el7-x86_64.zip
drwxrwxr-x 9 lightdb lightdb 4096 May 16 10:43 lightdb-a-stage
drwxrwxr-x 7 lightdb lightdb 4096 Sep 21 14:13 lightdb-x-13.8-23.3-14917-el7.x86_64
drwxrwxr-x 3 lightdb lightdb 4096 Apr 23 13:19 myfile
drwxr-xr-x 6 root root 4096 Apr 3 19:02 ora2pg
drwxr-xr-x 3 lightdb lightdb 4096 Apr 23 13:19 sql-convert-runtime
-rw-r--r-- 1 lightdb lightdb 918 May 15 13:22 test_prompt.sql
[lightdb@lightdb1 xjh]$ ltsql -p 5432
ltsql (13.8-23.3)
compatible type: postgresql
Type "help" for help.lightdb@postgres=# \lList of databasesName | Owner | Encoding | Collate | Ctype | Access privileges
-------------+---------+----------+---------------+---------------+----------------------etl | lightdb | UTF8 | en_US.utf8 | en_US.utf8 | =Tc/lightdb +| | | | | lightdb=CTc/lightdb +| | | | | etl=CTc/lightdbetlu2 | lightdb | UTF8 | en_US.utf8 | en_US.utf8 | =Tc/lightdb +| | | | | lightdb=CTc/lightdb +| | | | | etlu2=CTc/lightdbgb18030test | lightdb | GB18030 | zh_CN.gb18030 | zh_CN.gb18030 | lt_test | lightdb | UTF8 | en_US.utf8 | en_US.utf8 | postgres | lightdb | UTF8 | en_US.utf8 | en_US.utf8 | template0 | lightdb | UTF8 | en_US.utf8 | en_US.utf8 | =c/lightdb +| | | | | lightdb=CTc/lightdbtemplate1 | lightdb | UTF8 | en_US.utf8 | en_US.utf8 | =c/lightdb +| | | | | lightdb=CTc/lightdbutf_0928 | lightdb | UTF8 | en_US.utf8 | en_US.utf8 | =Tc/lightdb +| | | | | lightdb=CTc/lightdb +| | | | | utf_0928=CTc/lightdbutf_etl | lightdb | UTF8 | en_US.utf8 | en_US.utf8 | xjh | lightdb | UTF8 | en_US.utf8 | en_US.utf8 | =Tc/lightdb +| | | | | lightdb=CTc/lightdb +| | | | | xjh=CTc/lightdb
(10 rows)lightdb@postgres=# drop database gb18030test;
DROP DATABASE
lightdb@postgres=# \q
[lightdb@lightdb1 xjh]$ /data2/xjh/auto/lightdb-x/13.8-23.3/bin/ltsql -p 5432 utf_0928<gb18030test_0928_3.sql
SET
SET
SET
SET
SETset_config
------------lt_catalog
(1 row)SET
SET
SET
SET
ERROR: database "gb18030test" does not exist
CREATE DATABASE
ALTER DATABASE
You are now connected to database "gb18030test" as user "lightdb".
compatible type: postgresql
SET
SET
SET
SET
SETset_config
------------lt_catalog
(1 row)ALTER TABLE
ALTER TABLE
GRANT
[lightdb@lightdb1 xjh]$ ltsql -p5432
ltsql (13.8-23.3)
compatible type: postgresql
Type "help" for help.lightdb@postgres=# \lList of databasesName | Owner | Encoding | Collate | Ctype | Access privileges
-------------+---------+----------+---------------+---------------+----------------------etl | lightdb | UTF8 | en_US.utf8 | en_US.utf8 | =Tc/lightdb +| | | | | lightdb=CTc/lightdb +| | | | | etl=CTc/lightdbetlu2 | lightdb | UTF8 | en_US.utf8 | en_US.utf8 | =Tc/lightdb +| | | | | lightdb=CTc/lightdb +| | | | | etlu2=CTc/lightdbgb18030test | lightdb | GB18030 | zh_CN.gb18030 | zh_CN.gb18030 | lt_test | lightdb | UTF8 | en_US.utf8 | en_US.utf8 | postgres | lightdb | UTF8 | en_US.utf8 | en_US.utf8 | template0 | lightdb | UTF8 | en_US.utf8 | en_US.utf8 | =c/lightdb +| | | | | lightdb=CTc/lightdbtemplate1 | lightdb | UTF8 | en_US.utf8 | en_US.utf8 | =c/lightdb +| | | | | lightdb=CTc/lightdbutf_0928 | lightdb | UTF8 | en_US.utf8 | en_US.utf8 | =Tc/lightdb +| | | | | lightdb=CTc/lightdb +| | | | | utf_0928=CTc/lightdbutf_etl | lightdb | UTF8 | en_US.utf8 | en_US.utf8 | xjh | lightdb | UTF8 | en_US.utf8 | en_US.utf8 | =Tc/lightdb +| | | | | lightdb=CTc/lightdb +| | | | | xjh=CTc/lightdb
(10 rows)lightdb@postgres=# \c gb18030test
You are now connected to database "gb18030test" as user "lightdb".
compatible type: postgresql
lightdb@gb18030test=# select * from hr.gbk2;id | data
----+-----------------------------------36 | 37 | 1 | fhsjdhfjs看到回國的飛機共和黨國會2 | 付款的官方的理工科 3 | 看來是價格 4 | 快攻打法瞭解更多 5 | 84375jkdgkfckvkb堅不可摧v 6 | ;報價參考報價下 7 | 老闆超級不開心 8 | 了從包括v菠蘿快車v了 9 | 从离开滨江屡见不鲜 10 | 查看背景下来不及 差旅不可撤销吧11 | clvjbxj 12 | 了出现崩溃13 | 查看下礼拜38 |
(16 rows)lightdb@gb18030test=#