Commit c74d8a77 authored by Peter Eisentraut's avatar Peter Eisentraut

Domain support in PL/Python

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.
parent 79023381
/********************************************************************** /**********************************************************************
* plpython.c - python as a procedural language for PostgreSQL * plpython.c - python as a procedural language for PostgreSQL
* *
* $PostgreSQL: pgsql/src/pl/plpython/plpython.c,v 1.124 2009/08/13 20:50:05 petere Exp $ * $PostgreSQL: pgsql/src/pl/plpython/plpython.c,v 1.125 2009/08/14 13:12:21 petere Exp $
* *
********************************************************************* *********************************************************************
*/ */
...@@ -1641,7 +1641,7 @@ PLy_input_datum_func2(PLyDatumToOb *arg, Oid typeOid, HeapTuple typeTup) ...@@ -1641,7 +1641,7 @@ PLy_input_datum_func2(PLyDatumToOb *arg, Oid typeOid, HeapTuple typeTup)
arg->typbyval = typeStruct->typbyval; arg->typbyval = typeStruct->typbyval;
/* Determine which kind of Python object we will convert to */ /* Determine which kind of Python object we will convert to */
switch (typeOid) switch (getBaseType(typeOid))
{ {
case BOOLOID: case BOOLOID:
arg->func = PLyBool_FromString; arg->func = PLyBool_FromString;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment