pg_input_error_info doc 2 exampled crammed together

From: jian he <jian(dot)universality(at)gmail(dot)com>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: pg_input_error_info doc 2 exampled crammed together
Date: 2024-04-29 01:28:03
Message-ID: CACJufxGdyoBJQMSxwdxNK=k8M5WUth5FDFd4Wq_K4f7+1J2xuQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

hi.

select * from pg_input_error_info('42000000000', 'integer')
select message, detail from pg_input_error_info('1234.567', 'numeric(7,4)')
I found above two examples at [0] crammed together.

<para>
<literal>select * from pg_input_error_info('42000000000',
'integer')</literal>
<returnvalue></returnvalue>
<programlisting>
message | detail | hint
| sql_error_code
------------------------------------------------------+--------+------+----------------
value "42000000000" is out of range for type integer | | | 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>

after checking the definition of <programlisting>[1], <screen>[2],
maybe here we should use <screen> and also add `(1 row)` information.

or we can simply add a empty new line between
` value "42000000000" is out of range for type integer | | | 22003`
and
`</programlisting>`

[0] https://www.postgresql.org/docs/current/functions-info.html#FUNCTIONS-INFO-VALIDITY
[1] https://tdg.docbook.org/tdg/4.5/programlisting
[2] https://tdg.docbook.org/tdg/4.5/screen

--
I recommend David Deutsch's <<The Beginning of Infinity>>

Jian

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message wenhui qiu 2024-04-29 01:36:58 Re: Support "Right Semi Join" plan shapes
Previous Message Richard Guo 2024-04-29 01:12:48 A failure in prepared_xacts test