summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane2023-03-24 23:31:19 +0000
committerTom Lane2023-03-24 23:31:21 +0000
commit7023207cfdb6d5863bdcc9c29bff9918846dddc6 (patch)
treeae3e28bb601f41440a5f0a3f4a9ae22ac421aee0
parent642d8779768ecddc2917747940885d11f844f6e9 (diff)
Doc: fix examples for pg_input_error_info().
These were causing "contents ... exceed the available area" warnings in PDF builds, and also didn't quite follow our markup conventions for function examples. To fix the overwidth problem, reduce the number of fields shown in one example, and also insert &zwsp; to let the header line be broken in a reasonable place. Discussion: https://postgr.es/m/[email protected]
-rw-r--r--doc/src/sgml/func.sgml23
1 files changed, 14 insertions, 9 deletions
diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml
index 0987eb805a..974d7be8c2 100644
--- a/doc/src/sgml/func.sgml
+++ b/doc/src/sgml/func.sgml
@@ -24902,7 +24902,7 @@ SELECT collation for ('foo' COLLATE "de_DE");
<para>
Tests whether the given <parameter>string</parameter> is valid
input for the specified data type; if not, return the details of
- the error would have been thrown. If the input is valid, the
+ the error that would have been thrown. If the input is valid, the
results are NULL. The inputs are the same as
for <function>pg_input_is_valid</function>.
</para>
@@ -24912,18 +24912,23 @@ SELECT collation for ('foo' COLLATE "de_DE");
a <quote>soft</quote> error. Otherwise, invalid input will abort
the transaction, just as if the string had been cast to the type
directly.
- </para>
- <para>
+ </para>
+ <para>
+ <literal>select * from pg_input_error_info('42000000000', 'integer')</literal>
+ <returnvalue></returnvalue>
<programlisting>
-SELECT * FROM pg_input_error_info('42000000000', 'integer');
message | detail | hint | sql_error_code
------------------------------------------------------+--------+------+----------------
value "42000000000" is out of range for type integer | | | 22003
-
-SELECT * FROM pg_input_error_info('1234.567', 'numeric(7,4)');
- message | detail | hint | sql_error_code
-------------------------+-----------------------------------------------------------------------------------+------+----------------
- numeric field overflow | A field with precision 7, scale 4 must round to an absolute value less than 10^3. | | 22003
+</programlisting>
+ </para>
+ <para>
+ <literal>select message, detail from pg_input_error_info('1234.567', 'numeric(7,4)')</literal>
+ <returnvalue></returnvalue>
+<programlisting>
+ message | detail
+------------------------+----------------------------------&zwsp;-------------------------------------------------
+ numeric field overflow | A field with precision 7, scale 4 must round to an absolute value less than 10^3.
</programlisting>
</para></entry>
</row>