1
0
mirror of https://github.com/postgres/postgres.git synced 2025-08-24 09:27:52 +03:00

Allow pltcl args to spi_prepare and plpython args to plpy.prepare to be standard type aliases as well as those known in pg_type. Similar to recent change in plperl.

This commit is contained in:
Andrew Dunstan
2007-02-21 03:27:32 +00:00
parent 80ab3e0d34
commit afc7e0d848
3 changed files with 32 additions and 29 deletions

View File

@@ -2,7 +2,7 @@
* pltcl.c - PostgreSQL support for Tcl as
* procedural language (PL)
*
* $PostgreSQL: pgsql/src/pl/tcl/pltcl.c,v 1.110 2007/02/09 03:35:35 tgl Exp $
* $PostgreSQL: pgsql/src/pl/tcl/pltcl.c,v 1.111 2007/02/21 03:27:32 adunstan Exp $
*
**********************************************************************/
@@ -1808,23 +1808,22 @@ pltcl_SPI_prepare(ClientData cdata, Tcl_Interp *interp,
PG_TRY();
{
/************************************************************
* Lookup the argument types by name in the system cache
* and remember the required information for input conversion
* Resolve argument type names and then look them up by oid
* in the system cache, and remember the required information
* for input conversion.
************************************************************/
for (i = 0; i < nargs; i++)
{
List *names;
HeapTuple typeTup;
Oid typId, typInput, typIOParam;
int32 typmod;
/* Parse possibly-qualified type name and look it up in pg_type */
names = stringToQualifiedNameList(args[i],
"pltcl_SPI_prepare");
typeTup = typenameType(NULL, makeTypeNameFromNameList(names));
qdesc->argtypes[i] = HeapTupleGetOid(typeTup);
perm_fmgr_info(((Form_pg_type) GETSTRUCT(typeTup))->typinput,
&(qdesc->arginfuncs[i]));
qdesc->argtypioparams[i] = getTypeIOParam(typeTup);
ReleaseSysCache(typeTup);
parseTypeString(args[i], &typId, &typmod);
getTypeInputInfo(typId, &typInput, &typIOParam);
qdesc->argtypes[i] = typId;
perm_fmgr_info(typInput, &(qdesc->arginfuncs[i]));
qdesc->argtypioparams[i] = typIOParam;
}
/************************************************************