Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit f6b5d05

Browse files
committed
doc: Document pg_encoding_to_char() and pg_char_to_encoding().
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
1 parent 826584f commit f6b5d05

File tree

2 files changed

+35
-3
lines changed

2 files changed

+35
-3
lines changed

doc/src/sgml/catalogs.sgml

+5-3
Original file line numberDiff line numberDiff line change
@@ -2819,7 +2819,8 @@ SCRAM-SHA-256$<replaceable>&lt;iteration count&gt;</replaceable>:<replaceable>&l
28192819
<structfield>conforencoding</structfield> <type>int4</type>
28202820
</para>
28212821
<para>
2822-
Source encoding ID
2822+
Source encoding ID (<link linkend="pg-encoding-to-char"><function>pg_encoding_to_char()</function></link>
2823+
can translate this number to the encoding name)
28232824
</para></entry>
28242825
</row>
28252826

@@ -2828,7 +2829,8 @@ SCRAM-SHA-256$<replaceable>&lt;iteration count&gt;</replaceable>:<replaceable>&l
28282829
<structfield>contoencoding</structfield> <type>int4</type>
28292830
</para>
28302831
<para>
2831-
Destination encoding ID
2832+
Destination encoding ID (<link linkend="pg-encoding-to-char"><function>pg_encoding_to_char()</function></link>
2833+
can translate this number to the encoding name)
28322834
</para></entry>
28332835
</row>
28342836

@@ -2927,7 +2929,7 @@ SCRAM-SHA-256$<replaceable>&lt;iteration count&gt;</replaceable>:<replaceable>&l
29272929
</para>
29282930
<para>
29292931
Character encoding for this database
2930-
(<function>pg_encoding_to_char()</function> can translate
2932+
(<link linkend="pg-encoding-to-char"><function>pg_encoding_to_char()</function></link> can translate
29312933
this number to the encoding name)
29322934
</para></entry>
29332935
</row>

doc/src/sgml/func.sgml

+30
Original file line numberDiff line numberDiff line change
@@ -23328,6 +23328,36 @@ SELECT pg_type_is_visible('myschema.widget'::regtype);
2332823328
</para></entry>
2332923329
</row>
2333023330

23331+
<row>
23332+
<entry id="pg-char-to-encoding" role="func_table_entry"><para role="func_signature">
23333+
<indexterm>
23334+
<primary>pg_char_to_encoding</primary>
23335+
</indexterm>
23336+
<function>pg_char_to_encoding</function> ( <parameter>encoding</parameter> <type>name</type> )
23337+
<returnvalue>integer</returnvalue>
23338+
</para>
23339+
<para>
23340+
Converts the supplied encoding name into an integer representing the
23341+
internal identifier used in some system catalog tables.
23342+
Returns <literal>-1</literal> if an unknown encoding name is provided.
23343+
</para></entry>
23344+
</row>
23345+
23346+
<row>
23347+
<entry id="pg-encoding-to-char" role="func_table_entry"><para role="func_signature">
23348+
<indexterm>
23349+
<primary>pg_encoding_to_char</primary>
23350+
</indexterm>
23351+
<function>pg_encoding_to_char</function> ( <parameter>encoding</parameter> <type>integer</type> )
23352+
<returnvalue>name</returnvalue>
23353+
</para>
23354+
<para>
23355+
Converts the integer used as the internal identifier of an encoding in some
23356+
system catalog tables into a human-readable string.
23357+
Returns an empty string if an invalid encoding number is provided.
23358+
</para></entry>
23359+
</row>
23360+
2333123361
<row>
2333223362
<entry role="func_table_entry"><para role="func_signature">
2333323363
<indexterm>

0 commit comments

Comments
 (0)