doc: Clarify that empty COMMENT string removes the comment.

Clarify the documentation of COMMENT ON to state that specifying an empty
string is treated as NULL, meaning that the comment is removed.

This makes the behavior explicit and avoids possible confusion about how
empty strings are handled.

Also adds regress test cases that use empty string to remove a comment.

Backpatch to all supported versions.

Author: Chao Li <[email protected]>
Reviewed-by: Ashutosh Bapat <[email protected]>
Reviewed-by: David G. Johnston <[email protected]>
Reviewed-by: Shengbin Zhao <[email protected]>
Reviewed-by: Jim Jones <[email protected]>
Reviewed-by: zhangqiang <[email protected]>
Reviewed-by: Fujii Masao <[email protected]>
Discussion: https://postgr.es/m/[email protected]
Backpatch-through: 14

Branch
------
REL_15_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/4574dd44da3c0a922ebd7117ee5229dbe3f2c84f

Modified Files
--------------
doc/src/sgml/ref/comment.sgml              | 18 +++++++++++-------
src/test/regress/expected/create_index.out | 14 ++++++++++++++
src/test/regress/expected/create_role.out  | 28 ++++++++++++++++++++++++++++
src/test/regress/sql/create_index.sql      |  4 ++++
src/test/regress/sql/create_role.sql       |  8 ++++++++
5 files changed, 65 insertions(+), 7 deletions(-)

Reply via email to