summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorTom Lane2022-12-09 15:08:44 +0000
committerTom Lane2022-12-09 15:08:44 +0000
commit1939d26282b27b4b264c6930830a7991ed83917a (patch)
tree9e2ff9c38937b85ed5307e8d4cf9b7dd86f97591 /src/include
parentd9f7f5d32f201bec61fef8104aafcb77cecb4dcb (diff)
Add test scaffolding for soft error reporting from input functions.
pg_input_is_valid() returns boolean, while pg_input_error_message() returns the primary error message if the input is bad, or NULL if the input is OK. The main reason for having two functions is so that we can test both the details-wanted and the no-details-wanted code paths. Although these are primarily designed with testing in mind, it could well be that they'll be useful to end users as well. This patch is mostly by me, but it owes very substantial debt to earlier work by Nikita Glukhov, Andrew Dunstan, and Amul Sul. Thanks to Andres Freund for review. Discussion: https://postgr.es/m/3bbbb0df-7382-bf87-9737-340ba096e034@postgrespro.ru
Diffstat (limited to 'src/include')
-rw-r--r--src/include/catalog/catversion.h2
-rw-r--r--src/include/catalog/pg_proc.dat8
2 files changed, 9 insertions, 1 deletions
diff --git a/src/include/catalog/catversion.h b/src/include/catalog/catversion.h
index 17958aebf46..501a434b904 100644
--- a/src/include/catalog/catversion.h
+++ b/src/include/catalog/catversion.h
@@ -57,6 +57,6 @@
*/
/* yyyymmddN */
-#define CATALOG_VERSION_NO 202212091
+#define CATALOG_VERSION_NO 202212092
#endif
diff --git a/src/include/catalog/pg_proc.dat b/src/include/catalog/pg_proc.dat
index f9301b2627e..719599649a9 100644
--- a/src/include/catalog/pg_proc.dat
+++ b/src/include/catalog/pg_proc.dat
@@ -7060,6 +7060,14 @@
prorettype => 'regnamespace', proargtypes => 'text',
prosrc => 'to_regnamespace' },
+{ oid => '8050', descr => 'test whether string is valid input for data type',
+ proname => 'pg_input_is_valid', provolatile => 's', prorettype => 'bool',
+ proargtypes => 'text text', prosrc => 'pg_input_is_valid' },
+{ oid => '8051',
+ descr => 'get error message if string is not valid input for data type',
+ proname => 'pg_input_error_message', provolatile => 's', prorettype => 'text',
+ proargtypes => 'text text', prosrc => 'pg_input_error_message' },
+
{ oid => '1268',
descr => 'parse qualified identifier to array of identifiers',
proname => 'parse_ident', prorettype => '_text', proargtypes => 'text bool',