When you create a table, if the column type of the table is VARCHAR2 (byte) or CHAR (byte), the method of calculating the width of the type is incorrect.
Thanks for your reporting. Seems there is no issue for following result. postgres=# SELECT lengthb(cast('Highgo DB!' as varchar2(20))) from dual; lengthb
10
(1 row)
postgres=# SELECT lengthb(cast('Highgo DB!' as char(20))) from dual; lengthb
20
(1 row)
@gaoxueyu may I know how you managed to create table with columns of data type varchar2? because when I tried, it says type varchar2 does not exist. Ways to reproduce error: SET compatible_mode TO oracle; CREATE TABLE books ( id INT, title VARCHAR2(100), author VARCHAR2(100), price NUMBER);
@gaoxueyu may I know how you managed to create table with columns of data type varchar2? because when I tried, it says type varchar2 does not exist. Ways to reproduce error: SET compatible_mode TO oracle; CREATE TABLE books ( id INT, title VARCHAR2(100), author VARCHAR2(100), price NUMBER);
Please refer to #652