↑↓ select ↵ open ⌫ change scope Open full search

PG.CENTER connects PostgreSQL documentation, reference, and ecosystem knowledge. Maintained by Pigsty.

Functions / System Information Functions And Operators

pg_input_error_info

Read the PG 18 manual

Tests whether the given string is valid input for the specified data type; if not, return the details of the error that would have been thrown.

Reading PG 18current·documented in 5 of 27 versions, 16 to 20

Signatures & examples

pg_input_error_info ( string text, type text ) → record ( message text, detail text, hint text, sql_error_code text )
Tests whether the given string is valid input for the specified data type; if not, return the details of the error that would have been thrown. If the input is valid, the results are NULL. The inputs are the same as for pg_input_is_valid.
SELECT * FROM pg_input_error_info('42000000000', 'integer') →                        message                        | detail | hint | sql_error_code
------------------------------------------------------+--------+------+----------------
 value "42000000000" is out of range for type integer |        |      | 22003
Version history 1
  1. 15 → 16 added

Definition snapshot: b7bd9cda · English manual source