summaryrefslogtreecommitdiff
path: root/src/pl/plpython/plpython.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2008-07-16 01:30:23 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2008-07-16 01:30:23 +0000
commitd89737d31c03d90a2b0412e63953493576a2a3d7 (patch)
tree0afc63e59fae7ec3c53339641a6f65e6a04733d2 /src/pl/plpython/plpython.c
parent2c773296f88fe800315ca1bf131287662ecef999 (diff)
Support "variadic" functions, which can accept a variable number of arguments
so long as all the trailing arguments are of the same (non-array) type. The function receives them as a single array argument (which is why they have to all be the same type). It might be useful to extend this facility to aggregates, but this patch doesn't do that. This patch imposes a noticeable slowdown on function lookup --- a follow-on patch will fix that by adding a redundant column to pg_proc. Pavel Stehule
Diffstat (limited to 'src/pl/plpython/plpython.c')
-rw-r--r--src/pl/plpython/plpython.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/pl/plpython/plpython.c b/src/pl/plpython/plpython.c
index a2da9a6dcee..8e85c6707e2 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.110 2008/05/12 00:00:54 alvherre Exp $
+ * $PostgreSQL: pgsql/src/pl/plpython/plpython.c,v 1.111 2008/07/16 01:30:23 tgl Exp $
*
*********************************************************************
*/
@@ -1271,7 +1271,7 @@ PLy_procedure_create(HeapTuple procTup, Oid tgreloid, char *key)
/* proc->nargs was initialized to 0 above */
for (i = 0; i < total; i++)
{
- if (modes[i] != 'o')
+ if (modes[i] != PROARGMODE_OUT)
(proc->nargs)++;
}
}
@@ -1282,8 +1282,8 @@ PLy_procedure_create(HeapTuple procTup, Oid tgreloid, char *key)
HeapTuple argTypeTup;
Form_pg_type argTypeStruct;
- if (modes && modes[i] == 'o') /* skip OUT arguments */
- continue;
+ if (modes && modes[i] == PROARGMODE_OUT)
+ continue; /* skip OUT arguments */
Assert(types[i] == procStruct->proargtypes.values[pos]);