GUC Parameters

sql_mode

Parameter description: The parameter value is a character string separated by commas (,). Only valid character strings are allowed. If the parameter value is invalid, a warning is reported after the startup. Similarly, if the new value is invalid, a warning is reported and the old value is not changed. The default string of the current sql_mode is sql_mode_strict,sql_mode_full_group. Currently, sql_mode is used in the following scenarios:

  1. sql_mode_strict: When a value that does not comply with the current column type is inserted, data conversion is performed. There are two scenarios: insert into table values (…) and insert into table select …. Conversion between various data types is involved. Currently, the following types are involved: tinyint (tinyint is not considered because its data scope is different from that of MySQL), smallint, int, bigint, float, double, numeric, clob, char, and varchar.
  2. sql_mode_strict: If the length of the inserted column value exceeds the length limit of the column, the maximum or minimum value is assigned to the column. The involved types are tinyint, smallint, int, bigint, float, double, numeric, clob, char, and varchar.
  3. sql_mode_strict: During insert, if a column whose attribute is not empty and does not have a default value is not in the insert list, the default value is added to the column. (The involved types are the same as the preceding types.)
  4. sql_mode_strict: supports explicit insertion of default to columns whose attributes are not empty and do not have default values. (The involved types are the same as the preceding types.)
  5. sql_mode_full_group: determines whether columns (without aggregate functions) in the SELECT list must be included in the GROUP BY clause. In sql_mode_full_group mode (default mode), if a column in the select list does not use an aggregate function or appear in the GROUP BY clause, an error is reported. Otherwise, the execution is successful and the first tuple is selected from all tuples that meet the conditions.

This parameter is a SIGHUP parameter. Set it based on instructions provided in Table 1.

Value range: a string

Default value: 'sql_mode_strict,sql_mode_full_group'

Example:

--Create a table named test1.
openGauss=# CREATE TABLE test1
(
  a1 smallint not null,
  a2 int not null,
  a3 bigint not null,
  a4 float not null,
  a5 double not null,
  a6 numeric not null,
  a7 varchar(5) not null
);

--Failed to insert records into the table.
openGauss=# insert into test1(a1,a2) values(123412342342314,3453453453434324);
--Failed to query the table.
openGauss=# select a1,a2 from test1 group by a1;

--A record is successfully inserted into the table.
openGauss=# set sql_mode = '';
openGauss=# insert into test1(a1,a2) values(123412342342314,3453453453434324);
--A table is queried successfully.
openGauss=# select a1,a2 from test1 group by a1;

--Deleting a Table
openGauss=# DROP TABLE test1;

b_db_timestamp

Parameter description: The parameter value is a floating point number. This parameter affects the curdate, current_time, curtime, current_timestamp, localtime, localtimestamp, and now functions in Dolphin. If this parameter is set to 0, the preceding functions return the current date or time. If the parameter value is within the range [1,2147483647], the preceding functions use the value of this parameter as the second offset and return the date or time corresponding to 1970-01-01 00:00:00 UTC + Second offset + Current time zone offset. If the value of this parameter is not in the preceding valid range, an error is reported.

This parameter is a USERSET parameter. Set it based on instructions provided in Table 1.

Value range: [1.0, 2147483647.0]

Default value: 0

Example

openGauss=# show b_db_timestamp;
 b_db_timestamp
----------------
 0
(1 row)

openGauss=# select now();
        now()
---------------------
 2022-09-18 19:52:23
(1 row)

openGauss=# set b_db_timestamp = 1.0;
SET
openGauss=# select now();
        now()
---------------------
 1970-01-01 08:00:01
(1 row)

default_week_format

Parameter description: The parameter value is an integer. This parameter affects the week function in the Dolphin plug-in. The value range of this parameter is [0,7], which corresponds to eight calculation policies. For details about these policies, see Time and Date Functions . If the value of this GUC parameter exceeds the corresponding boundary value, a warning is reported and the GUC parameter is set to the corresponding boundary value.

This parameter is a SIGHUP parameter. Set it based on instructions provided in Table 1.

Value range: [0, 7]

Default value: 0

Example

openGauss=# show default_week_format;
default_week_format
---------------------
0
(1 row)

openGauss=# select week('2000-1-1');
week
------
    0
(1 row)

openGauss=# alter system set default_week_format = 2;
ALTER SYSTEM SET

openGauss=# select week('2000-1-1');
week
------
52
(1 row)

lc_time_names

Parameter description: Specifies the language in which the dayname and monthname functions of the dolphin plug-in output results. The parameter value is a character string. There are 111 values for this parameter. If the value of a parameter is not within the valid value range, an error is reported.

This parameter is a SIGHUP parameter. Set it based on instructions provided in Table 1.

Value range: The options of lc_time_names are as follows:

ValueLanguage Set
ar_AEArabic - United Arab Emirates
ar_BHArabic - Bahrain
ar_DZArabic - Algeria
ar_EGArabic - Egypt
ar_INArabic - India
ar_IQArabic - Iraq
ar_JOArabic - Jordan
ar_KWArabic - Kuwait
ar_LBArabic - Lebanon
ar_LYArabic - Libya
ar_MAArabic - Morocco
ar_OMArabic - Oman
ar_QAArabic - Qatar
ar_SAArabic - Saudi Arabia
ar_SDArabic - Sudan
ar_SYArabic - Syria
ar_TNArabic - Tunisia
ar_YEArabic - Yemen
be_BYBelarusian - Belarus
bg_BGBulgarian - Bulgaria
ca_ESCatalan - Spain
cs_CZCzech - Czech Republic
da_DKDanish - Denmark
de_ATGerman - Austria
de_BEGerman - Belgium
de_CHGerman - Switzerland
de_DEGerman - Germany
de_LUGerman - Luxembourg
el_GRGreek - Greece
en_AUEnglish - Australia
en_CAEnglish - Canada
en_GBEnglish - United Kingdom
en_INEnglish - India
en_NZEnglish - New Zealand
en_PHEnglish - Philippines
en_USEnglish - United States
en_ZAEnglish - South Africa
en_ZWEnglish - Zimbabwe
es_ARSpanish - Argentina
es_BOSpanish - Bolivia
es_CLSpanish - Chile
es_COSpanish - Colombia
es_CRSpanish - Costa Rica
es_DOSpanish - Dominican Republic
es_ECSpanish - Ecuador
es_ESSpanish - Spain
es_GTSpanish - Guatemala
es_HNSpanish - Honduras
es_MXSpanish - Mexico
es_NISpanish - Nicaragua
es_PASpanish - Panama
es_PESpanish - Peru
es_PRSpanish - Puerto Rico
es_PYSpanish - Paraguay
es_SVSpanish - El Salvador
es_USSpanish - United States
es_UYSpanish - Uruguay
es_VESpanish - Venezuela
et_EEEstonian - Estonia
eu_ESBasque - Spain
fi_FIFinnish - Finland
fo_FOFaroese - Faroe Islands
fr_BEFrench - Belgium
fr_CAFrench - Canada
fr_CHFrench - Switzerland
fr_FRFrench - France
fr_LUFrench - Luxembourg
gl_ESGalician - Spain
gu_INGujarati - India
he_ILHebrew - Israel
hi_INHindi - India
hr_HRCroatian - Croatia
hu_HUHungarian - Hungary
id_IDIndonesian - Indonesia
is_ISIcelandic - Iceland
it_CHItalian - Switzerland
it_ITItalian - Italy
ja_JPJapanese - Japan
ko_KRKorean - Republic of Korea
lt_LTLithuanian - Lithuania
lv_LVLatvian - Latvia
mk_MKMacedonian - North Macedonia
mn_MNMongolia - Mongolian
ms_MYMalay - Malaysia
nb_NONorwegian(Bokmål) - Norway
nl_BEDutch - Belgium
nl_NLDutch - The Netherlands
no_NONorwegian - Norway
pl_PLPolish - Poland
pt_BRPortugese - Brazil
pt_PTPortugese - Portugal
rm_CHRomansh - Switzerland
ro_RORomanian - Romania
ru_RURussian - Russia
ru_UARussian - Ukraine
sk_SKSlovak - Slovakia
sl_SISlovenian - Slovenia
sq_ALAlbanian - Albania
sr_RSSerbian - Serbia
sv_FISwedish - Finland
sv_SESwedish - Sweden
ta_INTamil - India
te_INTelugu - India
th_THThai - Thailand
tr_TRTurkish - Turkey
uk_UAUkrainian - Ukraine
ur_PKUrdu - Pakistan
vi_VNVietnamese - Vietnam
zh_CNChinese - China
zh_HKChinese - Hong Kong
zh_TWChinese - Taiwan

Default value: 'en_US'

Example

openGauss=# select dayname('2000-1-1');
dayname
----------
Saturday
(1 row)

openGauss=# alter system set lc_time_names = 'zh_CN';
ALTER SYSTEM SET

openGauss=# select dayname('2000-1-1');
dayname
---------
Saturday
(1 row)
Feedback
编组 3备份
    openGauss 2025-09-25 07:42:46
    cancel