diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2002-03-29 19:06:29 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2002-03-29 19:06:29 +0000 |
commit | d5e99ab4d6718e8ef515575e33fb5c6181cdcc96 (patch) | |
tree | 6c817d6358f50ae920207245c3b862b2cdd74ceb /src/pl/plpython/plpython.c | |
parent | 7c1ff354105e2256d7904497d8e282ccec53d2e6 (diff) | |
download | postgresql-d5e99ab4d6718e8ef515575e33fb5c6181cdcc96.tar.gz postgresql-d5e99ab4d6718e8ef515575e33fb5c6181cdcc96.zip |
pg_type has a typnamespace column; system now supports creating types
in different namespaces. Also, cleanup work on relation namespace
support: drop, alter, rename commands work for tables in non-default
namespaces.
Diffstat (limited to 'src/pl/plpython/plpython.c')
-rw-r--r-- | src/pl/plpython/plpython.c | 26 |
1 files changed, 9 insertions, 17 deletions
diff --git a/src/pl/plpython/plpython.c b/src/pl/plpython/plpython.c index e56f9254cff..9821f75335b 100644 --- a/src/pl/plpython/plpython.c +++ b/src/pl/plpython/plpython.c @@ -29,7 +29,7 @@ * MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/pl/plpython/plpython.c,v 1.16 2002/03/06 18:50:32 momjian Exp $ + * $Header: /cvsroot/pgsql/src/pl/plpython/plpython.c,v 1.17 2002/03/29 19:06:27 tgl Exp $ * ********************************************************************* */ @@ -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 */ |