Help Center/ GaussDB/ Developer Guide(Centralized_V2.0-8.x)/ FAQ/ What Is the Relationship Between an Empty String and NULL?
Updated on 2025-08-19 GMT+08:00
What Is the Relationship Between an Empty String and NULL?
Answer: Whether an empty string in GaussDB is NULL depends on the compatibility mode of the database.
- A null string is judged as NULL in A-compatible mode.
gaussdb=# CREATE DATABASE db_test1 DBCOMPATIBILITY = 'A'; gaussdb=# \c db_test1 db_test1=# SELECT '' IS NULL; ?column? ---------- t (1 row)
- A null string is not judged as NULL in B-compatible mode.
gaussdb=# CREATE DATABASE db_test2 DBCOMPATIBILITY = 'B'; gaussdb=# \c db_test2 db_test2=# SELECT '' IS NULL; ?column? ---------- f (1 row)
Parent topic: FAQ
What is your overall rating for this page?
0
1
2
3
4
5
6
7
8
9
10
Very dissatisfiedVery satisfied
Thank you very much for your feedback. We will continue working to improve the documentation.
The system is busy. Please try again later.