Domain support in PL/Python
authorPeter Eisentraut <peter_e@gmx.net>
Fri, 14 Aug 2009 13:12:21 +0000 (13:12 +0000)
committerPeter Eisentraut <peter_e@gmx.net>
Fri, 14 Aug 2009 13:12:21 +0000 (13:12 +0000)
When examining what Python type to convert a PostgreSQL type to on input,
look at the base type of the input type, otherwise all domains end up
defaulting to string.

src/pl/plpython/plpython.c

index 07da41b01c41668a474d7dc021d592a7410c359d..cfc22259b895c4a1db4ed1717f52b209771db723 100644 (file)
@@ -1641,7 +1641,7 @@ PLy_input_datum_func2(PLyDatumToOb *arg, Oid typeOid, HeapTuple typeTup)
        arg->typbyval = typeStruct->typbyval;
 
        /* Determine which kind of Python object we will convert to */
-       switch (typeOid)
+       switch (getBaseType(typeOid))
        {
                case BOOLOID:
                        arg->func = PLyBool_FromString;