pgsql: Suppress uninitialized-variable warning from a61b1f748.

2022-12-27 Thread Tom Lane
Suppress uninitialized-variable warning from a61b1f748. Some compilers complain about sub_rteperminfos not being initialized, evidently because they don't detect that it is only used and set if isGeneralSelect is true. Make it follow the long-established pattern for its sibling variable sub_rtable

pgsql: Convert hstore_in to report errors softly.

2022-12-27 Thread Tom Lane
Convert hstore_in to report errors softly. The error reporting here was not only old and crufty, but untested. I took the opportunity to bring the messages into some sort of compliance with our message style guidelines. Discussion: https://postgr.es/m/6b6a5c77-60ad-4a71-9f3a-b2c026a28...@dunslan

pgsql: Remove new locale dependency in regproc regression test.

2022-12-27 Thread Tom Lane
Remove new locale dependency in regproc regression test. The modified error message for regcollationin failure includes the database encoding, which it should've occurred to me is a portability hazard for the regression tests. Adjust the test so the expected output doesn't include that. In passi

pgsql: Simplify the implementations of the to_reg* functions.

2022-12-27 Thread Tom Lane
Simplify the implementations of the to_reg* functions. Given the soft-input-error feature, we can reduce these functions to be just thin wrappers around a soft-error call of the corresponding datatype input function. This means less code and more certainty that the to_reg* functions match the nor

pgsql: Convert the reg* input functions to report (most) errors softly.

2022-12-27 Thread Tom Lane
Convert the reg* input functions to report (most) errors softly. This is not really complete, but it catches most cases of practical interest. The main omissions are: * regtype, regprocedure, and regoperator parse type names by calling the main grammar, so any grammar-detected syntax error will

pgsql: Convert tsqueryin and tsvectorin to report errors softly.

2022-12-27 Thread Tom Lane
Convert tsqueryin and tsvectorin to report errors softly. This is slightly tedious because the adjustments cascade through a couple of levels of subroutines, but it's not very hard. I chose to avoid changing function signatures more than absolutely necessary, by passing the escontext pointer in ex

pgsql: Detect bad input for types xid, xid8, and cid.

2022-12-27 Thread Tom Lane
Detect bad input for types xid, xid8, and cid. Historically these input functions just called strtoul or strtoull and returned the result, with no error detection whatever. Upgrade them to reject garbage input and out-of-range values, similarly to our other numeric input routines. To share the c