This topic describes how to create data of the VARCHAR2 type in PolarDB O Edition.


The VARCHAR2 data type is enabled by running the following statements. By default, PolarDB O Edition does not support the VARCHAR2 data type.

alter system set polar_enable_varchar2_length_with_byte=on;
select pg_reload_conf();
show polar_enable_varchar2_length_with_byte;


 VARCHAR2(maximum_size [CHAR | BYTE])


Parameter Description
maximum_size The maximum length of the VARCHAR2 data type.
[CHAR | BYTE] The method that is used to measure the VARCHAR2 data length. Valid values: CHAR and BYTE.


create table t (col varchar2(10 byte));
create table t (col varchar2(10 char));