Skip to content

Commit 7023207

Browse files
committed
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/20230324194701.dqkzcdtlcikseo22@awork3.anarazel.de
1 parent 642d877 commit 7023207

File tree

1 file changed

+14
-9
lines changed

1 file changed

+14
-9
lines changed

doc/src/sgml/func.sgml

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24902,7 +24902,7 @@ SELECT collation for ('foo' COLLATE "de_DE");
2490224902
<para>
2490324903
Tests whether the given <parameter>string</parameter> is valid
2490424904
input for the specified data type; if not, return the details of
24905-
the error would have been thrown. If the input is valid, the
24905+
the error that would have been thrown. If the input is valid, the
2490624906
results are NULL. The inputs are the same as
2490724907
for <function>pg_input_is_valid</function>.
2490824908
</para>
@@ -24912,18 +24912,23 @@ SELECT collation for ('foo' COLLATE "de_DE");
2491224912
a <quote>soft</quote> error. Otherwise, invalid input will abort
2491324913
the transaction, just as if the string had been cast to the type
2491424914
directly.
24915-
</para>
24916-
<para>
24915+
</para>
24916+
<para>
24917+
<literal>select * from pg_input_error_info('42000000000', 'integer')</literal>
24918+
<returnvalue></returnvalue>
2491724919
<programlisting>
24918-
SELECT * FROM pg_input_error_info('42000000000', 'integer');
2491924920
message | detail | hint | sql_error_code
2492024921
------------------------------------------------------+--------+------+----------------
2492124922
value "42000000000" is out of range for type integer | | | 22003
24922-
24923-
SELECT * FROM pg_input_error_info('1234.567', 'numeric(7,4)');
24924-
message | detail | hint | sql_error_code
24925-
------------------------+-----------------------------------------------------------------------------------+------+----------------
24926-
numeric field overflow | A field with precision 7, scale 4 must round to an absolute value less than 10^3. | | 22003
24923+
</programlisting>
24924+
</para>
24925+
<para>
24926+
<literal>select message, detail from pg_input_error_info('1234.567', 'numeric(7,4)')</literal>
24927+
<returnvalue></returnvalue>
24928+
<programlisting>
24929+
message | detail
24930+
------------------------+----------------------------------&zwsp;-------------------------------------------------
24931+
numeric field overflow | A field with precision 7, scale 4 must round to an absolute value less than 10^3.
2492724932
</programlisting>
2492824933
</para></entry>
2492924934
</row>

0 commit comments

Comments
 (0)