doc: Document pg_encoding_to_char() and pg_char_to_encoding().
authorFujii Masao
Tue, 5 Oct 2021 03:52:51 +0000 (12:52 +0900)
committerFujii Masao
Tue, 5 Oct 2021 03:52:51 +0000 (12:52 +0900)
Previously both functions were not described anywhere in the docs.
But since they have been around since 7.0 and mentioned in the description
for system catalog like pg_database, it's reasonable to add short
descriptions for them.

Author: Ian Lawrence Barwick
Reviewed-by: Laurenz Albe, Fujii Masao
Discussion: https://postgr.es/m/CAB8KJ=infievn4q1N4X7Vx8w4_RMPPG0pLvxhSDjy5WQOSHW9g@mail.gmail.com

doc/src/sgml/catalogs.sgml
doc/src/sgml/func.sgml

index 384e6eaa3b0b983d790a09ccad45f383169c5977..fd6910ddbea1e94ab8e42d95580be2524b33f896 100644 (file)
@@ -2819,7 +2819,8 @@ SCRAM-SHA-256$<iteration count>:&l
        conforencoding int4
       
       
-       Source encoding ID
+       Source encoding ID (pg_encoding_to_char()
+       can translate this number to the encoding name)
       
      
 
@@ -2828,7 +2829,8 @@ SCRAM-SHA-256$<iteration count>:&l
        contoencoding int4
       
       
-       Destination encoding ID
+       Destination encoding ID (pg_encoding_to_char()
+       can translate this number to the encoding name)
       
      
 
@@ -2927,7 +2929,7 @@ SCRAM-SHA-256$<iteration count>:&l
       
       
        Character encoding for this database
-       (<function>pg_encoding_to_char()> can translate
+       (<link linkend="pg-encoding-to-char">pg_encoding_to_char()> can translate
        this number to the encoding name)
       
      
index 78812b2dbebe30d2cdb961397f8a3036e6d729e4..42dff83e160cb9e372dfdcf5b6a9f5e72c7a315a 100644 (file)
@@ -23328,6 +23328,36 @@ SELECT pg_type_is_visible('myschema.widget'::regtype);
        
       
 
+      
+       
+        
+         pg_char_to_encoding
+        
+        pg_char_to_encoding ( encoding name )
+        integer
+       
+       
+        Converts the supplied encoding name into an integer representing the
+        internal identifier used in some system catalog tables.
+        Returns -1 if an unknown encoding name is provided.
+       
+      
+
+      
+       
+        
+         pg_encoding_to_char
+        
+        pg_encoding_to_char ( encoding integer )
+        name
+       
+       
+        Converts the integer used as the internal identifier of an encoding in some
+        system catalog tables into a human-readable string.
+        Returns an empty string if an invalid encoding number is provided.
+       
+      
+