Skip to content

Commit 6c3c7b5

Browse files
committed
Allow generic record arguments to plperl functions
1 parent a3d40e9 commit 6c3c7b5

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/pl/plperl/plperl.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1371,7 +1371,8 @@ plperl_validator(PG_FUNCTION_ARGS)
13711371
&argtypes, &argnames, &argmodes);
13721372
for (i = 0; i < numargs; i++)
13731373
{
1374-
if (get_typtype(argtypes[i]) == TYPTYPE_PSEUDO)
1374+
if (get_typtype(argtypes[i]) == TYPTYPE_PSEUDO &&
1375+
argtypes[i] != RECORDOID)
13751376
ereport(ERROR,
13761377
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
13771378
errmsg("PL/Perl functions cannot accept type %s",
@@ -2105,7 +2106,8 @@ compile_plperl_function(Oid fn_oid, bool is_trigger)
21052106
typeStruct = (Form_pg_type) GETSTRUCT(typeTup);
21062107

21072108
/* Disallow pseudotype argument */
2108-
if (typeStruct->typtype == TYPTYPE_PSEUDO)
2109+
if (typeStruct->typtype == TYPTYPE_PSEUDO &&
2110+
procStruct->proargtypes.values[i] != RECORDOID)
21092111
{
21102112
free(prodesc->proname);
21112113
free(prodesc);
@@ -2115,7 +2117,8 @@ compile_plperl_function(Oid fn_oid, bool is_trigger)
21152117
format_type_be(procStruct->proargtypes.values[i]))));
21162118
}
21172119

2118-
if (typeStruct->typtype == TYPTYPE_COMPOSITE)
2120+
if (typeStruct->typtype == TYPTYPE_COMPOSITE ||
2121+
procStruct->proargtypes.values[i] == RECORDOID)
21192122
prodesc->arg_is_rowtype[i] = true;
21202123
else
21212124
{

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy