oracle GBK未定义编码使用Unicode写入特殊字符e000迁移lightdb-x测试

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=# 

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/93582.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

【智能家居项目】裸机版本——设备子系统(LED Display 风扇)

&#x1f431;作者&#xff1a;一只大喵咪1201 &#x1f431;专栏&#xff1a;《智能家居项目》 &#x1f525;格言&#xff1a;你只管努力&#xff0c;剩下的交给时间&#xff01; 输入子系统中目前仅实现了按键输入&#xff0c;剩下的网络输入和标准输入在以后会逐步实现&am…

【网络安全-sqlmap】sqlmap以及几款自动化sql注入工具的详细使用过程,超详细,SQL注入【5】

一&#xff0c;sqlmap 工具的详细使用 kali系统自带这个工具&#xff0c;无需安装直接sqlmap 后面接参数使用 Windows上参照以下方法安装即可 1-1 工具下载 1-1-1 sqlmap下载 sqlmap 工具下载地址&#xff1a; GitHub - sqlmapproject/sqlmap: Automatic SQL injection a…

Unity实现设计模式——状态模式

Unity实现设计模式——状态模式 状态模式最核心的设计思路就是将对象的状态抽象出一个接口&#xff0c;然后根据它的不同状态封装其行为&#xff0c;这样就可以实现状态和行为的绑定&#xff0c;最终实现对象和状态的有效解耦。 在实际开发中一般用到FSM有限状态机的实现&…

【JavaEE】JavaScript webAPI的基本知识

JavaScript Web API 文章目录 JavaScript Web APIwebAPI背景DOMDOM树 获取元素querySelectorquerySelectorAll 事件初识键盘事件onkeydownonkeypressonkeyup 操作元素获取/修改元素内容1.innerText2.innerHTML 获取/修改元素属性获取/修改表单元素属性获取/修改样式属性行内样式…

AI智能问答系统源码/AI绘画商业系统/支持GPT联网提问/支持Midjourney绘画

一、AI创作系统 SparkAi创作系统是基于国外很火的ChatGPT进行开发的AI智能问答系统和AI绘画系统。本期针对源码系统整体测试下来非常完美&#xff0c;可以说SparkAi是目前国内一款的ChatGPT对接OpenAI软件系统。那么如何搭建部署AI创作ChatGPT&#xff1f;小编这里写一个详细图…

TinyWebServer学习笔记-MySQL数据库连接

为什么要用数据库连接池&#xff1f; 我们的网站允许用户注册&#xff0c;在没有池的情况下&#xff0c;假设只有一个人&#xff0c;那么流程就是&#xff0c;用户点击注册&#xff0c;通过socket将用户的账号和密码发送到服务器&#xff0c;然后就需要创建MySQL数据库连接&am…

【Linux】文件权限详解

&#x1f341; 博主 "开着拖拉机回家"带您 Go to New World.✨&#x1f341; &#x1f984; 个人主页——&#x1f390;开着拖拉机回家_Linux,Java基础学习,大数据运维-CSDN博客 &#x1f390;✨&#x1f341; &#x1fa81;&#x1f341; 希望本文能够给您带来一定的…

使用Docker部署ElasticSearch7+ELK(附带ES操作操作命令集)

ElasticSearch 7ELK 程序安装Docker安装下载ES镜像提前创建挂载文件夹添加配置文件创建并启动容器可能出现的异常安装IK分词使用ElasticHD客户端工具(目前使用发现无法做增删改)安装Kibana 软件包安装安装ElasticSearch&#xff08;需要JDK1.8&#xff09;安装IK&#xff08;下…

【时区】Flink JDBC 和CDC时间字段时区 测试及时间基准

关联文章: 各种时间类型和timezone关系浅析 一、测试目的和值 1. 测试一般的数据库不含time zone的类型的时区。 mysql timestamp(3) 类型postgres timestamp(3) 类型sqlserver datetime2(3) 类型oracle类型 TIMESTAMP(3) 类型 在以下测试之中均为ts字段 2.测试CDC中元数据…

【数据结构】堆的应用-----TopK问题

目录 一、前言 二、Top-k问题 &#x1f4a6;解法一&#xff1a;暴力排序 &#x1f4a6;解法二&#xff1a;建立N个数的堆 &#x1f4a6;解法三&#xff1a;建立K个数的堆&#xff08;最优解&#xff09; 三、完整代码和视图 四、共勉 一、前言 在之前的文章中&#xff…

【Kubernetes】当K8s出现问题时,我们可以从哪些方面排查出

前言 kubernetes&#xff0c;简称K8s&#xff0c;是用8代替名字中间的8个字符“ubernete”而成的缩写。是一个开源的&#xff0c;用于管理云平台中多个主机上的容器化的应用&#xff0c;Kubernetes的目标是让部署容器化的应用简单并且高效&#xff08;powerful&#xff09;,Kub…

python中dir()和help()的作用

在 Python 中&#xff0c;dir() 和 help() 是两个常用的内置函数&#xff0c;用于获取对象的属性和方法信息以及提供帮助文档。 dir(object) 函数返回一个包含对象 object 的属性和方法名称的列表。如果没有提供参数&#xff0c;则返回当前作用域内的所有名称。例如&#xff0…

DAMA-DMBOK2重点知识整理CDGA/CDGP——第14章 大数据与数据科学

目录 一、分值分布 二、重点知识梳理 1、引言 1.1 业务驱动因素 1.2 原则 1.3 基本理念 2、活动 2.1 定义大数据战略和业务需求 2.2 选择数据源 2.3 获得和接收数据源 2.4 制定数据假设和方法 2.5 集成和调整数据进行分析 2.6 使用模型探索数据 2.7 部署和监控 …

Linux CentOS7 vim多文件与多窗口操作

窗口是可视化的分割区域。Windows中窗口的概念与linux中基本相同。连接xshell就是在Windows中新建一个窗口。而vim打开一个文件默认创建一个窗口。同时&#xff0c;Vim打开一个文件也就会建立一个缓冲区&#xff0c;打开多个文件就会创建多个缓冲区。 本文讨论vim中打开多个文…

【单片机】14-I2C通信之EEPROM

1.EEPROM概念 1.EEPROM 1.1 一些概念 &#xff08;1&#xff09;一些概念&#xff1a;ROM【只读存储器---硬盘】&#xff0c;RAM【随机访问存储器--内存】&#xff0c;PROM【可编程的ROM】&#xff0c;EPROM【可擦除ROM】&#xff0c;EEPROM【电可擦除ROM】 1.2 为什么需要EE…

应用大五人格测试,来做个人职业规划

应用大五人格测试做职业规划&#xff0c;一方面能让大学生清楚知晓自己的性格特征&#xff0c;置身适合怎样的职业&#xff0c;让他们结合自己的兴趣爱好职业走向&#xff0c;进一步了解自己适合做的职业规划。另一方面可以帮助他们结合职业规划来安排人生&#xff0c;一步一个…

Transformer学习-self-attention

这里写自定义目录标题 Self-attentionMulti-head self-attention用self-attention解决其他问题 Self-attention 用Wq、Wk、Wv分别乘输入向量得到q、k、v向量 用每个q向量乘所有的k向量得到对应项的attention&#xff0c;即用每项的query向量去匹配所有的key向量&#xff0c;得…

【进阶C语言】自定义类型

本节内容大致目录如下&#xff1a; 1.结构体 2.位段 3.枚举 4.联合&#xff08;共用体&#xff09; 以上都是C语言中的自定义类型&#xff0c;可以根据我们的需要去定义。 一、结构体 一些基础知识在初阶C语言的时候已经介绍过&#xff0c;在这里粗略概括&#xff1b;重…

代码随想录算法训练营第五十五天 | 动态规划 part 12 | 300.最长递增子序列、674. 最长连续递增序列、718. 最长重复子数组

目录 300.最长递增子序列思路代码 674. 最长连续递增序列思路代码 718. 最长重复子数组思路代码 300.最长递增子序列 Leetcode 思路 dp[i]表示i之前包括i的以nums[i]结尾的最长递增子序列的长度递推公式&#xff1a;if (nums[i] > nums[j]) dp[i] max(dp[i], dp[j] 1)初…

面试总结之Spring篇

一、AOP 1、什么是AOP 1.1、概述 AOP&#xff08;Aspect-Oriented Programming&#xff09;&#xff1a;面向切面编程&#xff0c;即把一些业务逻辑中的相同代码抽取出来&#xff0c;让业务逻辑更加简练清爽 如果要CRUD写一堆业务&#xff0c;可如何实现业务代码前后进行打印…