mirror of
https://github.com/postgres/postgres.git
synced 2025-09-03 15:22:11 +03:00
Add new to_reg* functions for error-free OID lookups.
These functions won't throw an error if the object doesn't exist, or if (for functions and operators) there's more than one matching object. Yugo Nagata and Nozomi Anzai, reviewed by Amit Khandekar, Marti Raudsepp, Amit Kapila, and me.
This commit is contained in:
@@ -3420,7 +3420,7 @@ plperl_spi_prepare(char *query, int argc, SV **argv)
|
||||
char *typstr;
|
||||
|
||||
typstr = sv2cstr(argv[i]);
|
||||
parseTypeString(typstr, &typId, &typmod);
|
||||
parseTypeString(typstr, &typId, &typmod, false);
|
||||
pfree(typstr);
|
||||
|
||||
getTypeInputInfo(typId, &typInput, &typIOParam);
|
||||
|
@@ -3492,7 +3492,7 @@ parse_datatype(const char *string, int location)
|
||||
error_context_stack = &syntax_errcontext;
|
||||
|
||||
/* Let the main parser try to parse it under standard SQL rules */
|
||||
parseTypeString(string, &type_id, &typmod);
|
||||
parseTypeString(string, &type_id, &typmod, false);
|
||||
|
||||
/* Restore former ereport callback */
|
||||
error_context_stack = syntax_errcontext.previous;
|
||||
|
@@ -113,7 +113,7 @@ PLy_spi_prepare(PyObject *self, PyObject *args)
|
||||
*information for input conversion.
|
||||
********************************************************/
|
||||
|
||||
parseTypeString(sptr, &typeId, &typmod);
|
||||
parseTypeString(sptr, &typeId, &typmod, false);
|
||||
|
||||
typeTup = SearchSysCache1(TYPEOID,
|
||||
ObjectIdGetDatum(typeId));
|
||||
|
@@ -2165,7 +2165,7 @@ pltcl_SPI_prepare(ClientData cdata, Tcl_Interp *interp,
|
||||
typIOParam;
|
||||
int32 typmod;
|
||||
|
||||
parseTypeString(args[i], &typId, &typmod);
|
||||
parseTypeString(args[i], &typId, &typmod, false);
|
||||
|
||||
getTypeInputInfo(typId, &typInput, &typIOParam);
|
||||
|
||||
|
Reference in New Issue
Block a user