Allow generic record arguments to plperl functions
This commit is contained in:
parent
a3d40e9fb5
commit
6c3c7b533e
|
@ -1371,7 +1371,8 @@ plperl_validator(PG_FUNCTION_ARGS)
|
||||||
&argtypes, &argnames, &argmodes);
|
&argtypes, &argnames, &argmodes);
|
||||||
for (i = 0; i < numargs; i++)
|
for (i = 0; i < numargs; i++)
|
||||||
{
|
{
|
||||||
if (get_typtype(argtypes[i]) == TYPTYPE_PSEUDO)
|
if (get_typtype(argtypes[i]) == TYPTYPE_PSEUDO &&
|
||||||
|
argtypes[i] != RECORDOID)
|
||||||
ereport(ERROR,
|
ereport(ERROR,
|
||||||
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
|
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
|
||||||
errmsg("PL/Perl functions cannot accept type %s",
|
errmsg("PL/Perl functions cannot accept type %s",
|
||||||
|
@ -2105,7 +2106,8 @@ compile_plperl_function(Oid fn_oid, bool is_trigger)
|
||||||
typeStruct = (Form_pg_type) GETSTRUCT(typeTup);
|
typeStruct = (Form_pg_type) GETSTRUCT(typeTup);
|
||||||
|
|
||||||
/* Disallow pseudotype argument */
|
/* Disallow pseudotype argument */
|
||||||
if (typeStruct->typtype == TYPTYPE_PSEUDO)
|
if (typeStruct->typtype == TYPTYPE_PSEUDO &&
|
||||||
|
procStruct->proargtypes.values[i] != RECORDOID)
|
||||||
{
|
{
|
||||||
free(prodesc->proname);
|
free(prodesc->proname);
|
||||||
free(prodesc);
|
free(prodesc);
|
||||||
|
@ -2115,7 +2117,8 @@ compile_plperl_function(Oid fn_oid, bool is_trigger)
|
||||||
format_type_be(procStruct->proargtypes.values[i]))));
|
format_type_be(procStruct->proargtypes.values[i]))));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (typeStruct->typtype == TYPTYPE_COMPOSITE)
|
if (typeStruct->typtype == TYPTYPE_COMPOSITE ||
|
||||||
|
procStruct->proargtypes.values[i] == RECORDOID)
|
||||||
prodesc->arg_is_rowtype[i] = true;
|
prodesc->arg_is_rowtype[i] = true;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue