Index: src/pl/plpython/plpython.c =================================================================== RCS file: /projects/cvsroot/pgsql-server/src/pl/plpython/plpython.c,v retrieving revision 1.22 diff -c -r1.22 plpython.c *** src/pl/plpython/plpython.c 2002/09/04 22:51:23 1.22 --- src/pl/plpython/plpython.c 2002/10/04 10:45:13 *************** *** 408,414 **** --- 408,416 ---- else PLy_restart_in_progress += 1; if (proc) + { Py_DECREF(proc->me); + } RERAISE_EXC(); } *************** *** 1841,1847 **** --- 1843,1856 ---- * * FIXME -- leaks saved plan on object destruction. can this be * avoided? + * I think so. A function prepares and then execp's a statement. + * When we come to deallocate the 'statement' object we obviously + * no long need the plan. Even if we did, without the object + * we're never going to be able to use it again. + * In the against arguments: SPI_saveplan has stuck this under + * the top context so there must be a reason for doing that. */ + pfree(ob->plan); } if (ob->types) PLy_free(ob->types); *************** *** 2374,2379 **** --- 2383,2390 ---- PyList_SetItem(result->rows, i, row); } PLy_typeinfo_dealloc(&args); + + SPI_freetuptable(tuptable); } RESTORE_EXC(); } Index: src/pl/plpython/plpython_schema.sql =================================================================== RCS file: /projects/cvsroot/pgsql-server/src/pl/plpython/plpython_schema.sql,v retrieving revision 1.1 diff -c -r1.1 plpython_schema.sql *** src/pl/plpython/plpython_schema.sql 2001/05/09 19:54:38 1.1 --- src/pl/plpython/plpython_schema.sql 2002/10/04 10:45:13 *************** *** 20,26 **** CREATE TABLE entry ( accession text not null primary key, ! eid serial, txid int2 not null references taxonomy(id) ) ; --- 20,26 ---- CREATE TABLE entry ( accession text not null primary key, ! eid serial unique, txid int2 not null references taxonomy(id) ) ; Index: src/pl/plpython/feature.expected =================================================================== RCS file: /projects/cvsroot/pgsql-server/src/pl/plpython/feature.expected,v retrieving revision 1.4 diff -c -r1.4 feature.expected *** src/pl/plpython/feature.expected 2002/03/06 18:50:31 1.4 --- src/pl/plpython/feature.expected 2002/10/04 10:45:14 *************** *** 29,35 **** (1 row) SELECT import_fail(); ! WARNING: ('import socket failed -- untrusted dynamic module: _socket',) import_fail -------------------- failed as expected --- 29,35 ---- (1 row) SELECT import_fail(); ! NOTICE: ('import socket failed -- untrusted dynamic module: _socket',) import_fail -------------------- failed as expected