Doc: clarify use of NULL to drop comments and security labels.
authorTom Lane
Tue, 31 Jan 2023 19:32:24 +0000 (14:32 -0500)
committerTom Lane
Tue, 31 Jan 2023 19:33:05 +0000 (14:33 -0500)
This was only mentioned in the description of the text/label, which
are marked as being in quotes in the synopsis, which can cause
confusion (as witnessed on IRC).

Also separate the literal and NULL cases in the parameter list, per
suggestion from Tom Lane.

Also add an example of dropping a security label.

Dagfinn Ilmari Mannsåker, with some tweaks by me

Discussion: https://postgr.es/m/[email protected]

doc/src/sgml/ref/comment.sgml
doc/src/sgml/ref/security_label.sgml

index 138cf718ce11ea2973e065fd3c779c2964e47dd4..ab69bd68c8910b12d409feea3d1bd870852157b1 100644 (file)
@@ -66,7 +66,7 @@ COMMENT ON
   TRIGGER trigger_name ON table_name |
   TYPE object_name |
   VIEW object_name
-} IS 'text'
+} IS string_literal | NULL }
 
 where aggregate_signature is:
 
@@ -264,11 +264,19 @@ COMMENT ON
     
 
    
-    text
+    string_literal
     
      
-      The new comment, written as a string literal; or NULL
-      to drop the comment.
+      The new comment contents, written as a string literal.
+     
+    
+   
+
+   
+    NULL
+    
+     
+      Write NULL to drop the comment.
      
     
    
index e9688cce214b22c56ccac4a0898876ab4dab7adb..720f319c8b2c829d9dfb267b3acfd7710d6610f8 100644 (file)
@@ -44,7 +44,7 @@ SECURITY LABEL [ FOR provider ] ON
   TABLESPACE object_name |
   TYPE object_name |
   VIEW object_name
-} IS 'label'
+} IS string_literal | NULL }
 
 where aggregate_signature is:
 
@@ -179,11 +179,19 @@ SECURITY LABEL [ FOR provider ] ON
     
 
    
-    label
+    string_literal
     
      
-      The new security label, written as a string literal; or NULL
-      to drop the security label.
+      The new setting of the security label, written as a string literal.
+     
+    
+   
+
+   
+    NULL
+    
+     
+      Write NULL to drop the security label.
      
     
    
@@ -194,12 +202,19 @@ SECURITY LABEL [ FOR provider ] ON
   Examples
 
   
-   The following example shows how the security label of a table might
-   be changed.
+   The following example shows how the security label of a table could
+   be set or changed:
 
 
 SECURITY LABEL FOR selinux ON TABLE mytable IS 'system_u:object_r:sepgsql_table_t:s0';
-
+
+
+   To remove the label:
+
+
+SECURITY LABEL FOR selinux ON TABLE mytable IS NULL;
+
+