diff options
Diffstat (limited to 'src/pl/plpython/plpython.c')
-rw-r--r-- | src/pl/plpython/plpython.c | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/src/pl/plpython/plpython.c b/src/pl/plpython/plpython.c index 0f4cd68bc2..b0dde28448 100644 --- a/src/pl/plpython/plpython.c +++ b/src/pl/plpython/plpython.c @@ -49,16 +49,16 @@ /* postgreSQL stuff */ -#include "executor/spi.h" +#include "access/heapam.h" +#include "catalog/pg_proc.h" +#include "catalog/pg_type.h" #include "commands/trigger.h" -#include "utils/elog.h" +#include "executor/spi.h" #include "fmgr.h" -#include "access/heapam.h" - +#include "nodes/makefuncs.h" +#include "parser/parse_type.h" #include "tcop/tcopprot.h" #include "utils/syscache.h" -#include "catalog/pg_proc.h" -#include "catalog/pg_type.h" #include <Python.h> #include "plpython.h" @@ -2086,16 +2086,8 @@ PLy_spi_prepare(PyObject * self, PyObject * args) RAISE_EXC(1); } sptr = PyString_AsString(optr); - typeTup = SearchSysCache(TYPENAME, PointerGetDatum(sptr), - 0, 0, 0); - if (!HeapTupleIsValid(typeTup)) - { - PLy_exception_set(PLy_exc_spi_error, - "Cache lookup for type `%s' failed.", - sptr); - RAISE_EXC(1); - } - + /* XXX should extend this to allow qualified type names */ + typeTup = typenameType(makeTypeName(sptr)); Py_DECREF(optr); optr = NULL; /* this is important */ |