diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2007-04-02 03:49:42 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2007-04-02 03:49:42 +0000 |
commit | 57690c6803525f879fe96920a05e979ece073e71 (patch) | |
tree | 42e82eaa1e9c8247b39a2ad783bf190b5001acfe /src/pl/plpython/plpython.c | |
parent | a482a3e58b3e5830899560c555e57e4184b8e6be (diff) | |
download | postgresql-57690c6803525f879fe96920a05e979ece073e71.tar.gz postgresql-57690c6803525f879fe96920a05e979ece073e71.zip |
Support enum data types. Along the way, use macros for the values of
pg_type.typtype whereever practical. Tom Dunstan, with some kibitzing
from Tom Lane.
Diffstat (limited to 'src/pl/plpython/plpython.c')
-rw-r--r-- | src/pl/plpython/plpython.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/pl/plpython/plpython.c b/src/pl/plpython/plpython.c index 78c9f6c66e0..31ce60373f6 100644 --- a/src/pl/plpython/plpython.c +++ b/src/pl/plpython/plpython.c @@ -1,7 +1,7 @@ /********************************************************************** * plpython.c - python as a procedural language for PostgreSQL * - * $PostgreSQL: pgsql/src/pl/plpython/plpython.c,v 1.96 2007/02/21 03:27:32 adunstan Exp $ + * $PostgreSQL: pgsql/src/pl/plpython/plpython.c,v 1.97 2007/04/02 03:49:42 tgl Exp $ * ********************************************************************* */ @@ -1185,7 +1185,7 @@ PLy_procedure_create(FunctionCallInfo fcinfo, Oid tgreloid, rvTypeStruct = (Form_pg_type) GETSTRUCT(rvTypeTup); /* Disallow pseudotype result, except for void */ - if (rvTypeStruct->typtype == 'p' && + if (rvTypeStruct->typtype == TYPTYPE_PSEUDO && procStruct->prorettype != VOIDOID) { if (procStruct->prorettype == TRIGGEROID) @@ -1199,7 +1199,7 @@ PLy_procedure_create(FunctionCallInfo fcinfo, Oid tgreloid, format_type_be(procStruct->prorettype)))); } - if (rvTypeStruct->typtype == 'c') + if (rvTypeStruct->typtype == TYPTYPE_COMPOSITE) { /* * Tuple: set up later, during first call to @@ -1258,13 +1258,13 @@ PLy_procedure_create(FunctionCallInfo fcinfo, Oid tgreloid, argTypeStruct = (Form_pg_type) GETSTRUCT(argTypeTup); /* Disallow pseudotype argument */ - if (argTypeStruct->typtype == 'p') + if (argTypeStruct->typtype == TYPTYPE_PSEUDO) ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("plpython functions cannot take type %s", format_type_be(procStruct->proargtypes.values[i])))); - if (argTypeStruct->typtype != 'c') + if (argTypeStruct->typtype != TYPTYPE_COMPOSITE) PLy_input_datum_func(&(proc->args[i]), procStruct->proargtypes.values[i], argTypeTup); @@ -2338,7 +2338,7 @@ PLy_spi_prepare(PyObject * self, PyObject * args) plan->types[i] = typeId; typeStruct = (Form_pg_type) GETSTRUCT(typeTup); - if (typeStruct->typtype != 'c') + if (typeStruct->typtype != TYPTYPE_COMPOSITE) PLy_output_datum_func(&plan->args[i], typeTup); else elog(ERROR, "tuples not handled in plpy.prepare, yet."); |