diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2004-01-06 23:55:19 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2004-01-06 23:55:19 +0000 |
commit | a77e32d7c5615e302fbc87803086132f1dab99a9 (patch) | |
tree | b03a6846d6909d6b1acb81c82a1e8fe3b98dbbb2 /src/pl/plpython/plpython.c | |
parent | 488f2785d025a6cc04685cfee4ca3eac0086e2fd (diff) |
Apply the core parts of Dennis Bjorklund's patch to allow function
parameters to be declared with names. pg_proc has a column to store
names, and CREATE FUNCTION can insert data into it, but that's all as
yet. I need to do more work on the pg_dump and plpgsql portions of the
patch before committing those, but I thought I'd get the bulky changes
in before the tree drifts under me.
initdb forced due to pg_proc change.
Diffstat (limited to 'src/pl/plpython/plpython.c')
-rw-r--r-- | src/pl/plpython/plpython.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/pl/plpython/plpython.c b/src/pl/plpython/plpython.c index 1e91fa109d8..54d612670d0 100644 --- a/src/pl/plpython/plpython.c +++ b/src/pl/plpython/plpython.c @@ -29,7 +29,7 @@ * MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. * * IDENTIFICATION - * $PostgreSQL: pgsql/src/pl/plpython/plpython.c,v 1.43 2004/01/04 00:14:17 momjian Exp $ + * $PostgreSQL: pgsql/src/pl/plpython/plpython.c,v 1.44 2004/01/06 23:55:19 tgl Exp $ * ********************************************************************* */ @@ -1032,7 +1032,8 @@ PLy_procedure_create(FunctionCallInfo fcinfo, Oid tgreloid, Form_pg_proc procStruct; PLyProcedure *volatile proc; char *volatile procSource = NULL; - Datum procDatum; + Datum prosrcdatum; + bool isnull; int i, rv; @@ -1153,9 +1154,12 @@ PLy_procedure_create(FunctionCallInfo fcinfo, Oid tgreloid, /* * get the text of the function. */ - procDatum = DirectFunctionCall1(textout, - PointerGetDatum(&procStruct->prosrc)); - procSource = DatumGetCString(procDatum); + prosrcdatum = SysCacheGetAttr(PROCOID, procTup, + Anum_pg_proc_prosrc, &isnull); + if (isnull) + elog(ERROR, "null prosrc"); + procSource = DatumGetCString(DirectFunctionCall1(textout, + prosrcdatum)); PLy_procedure_compile(proc, procSource); |