Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 2d6c375

Browse files
committed
Back out patch. This should be done like other server-side languages.
--------------------------------------------------------------------------- This patch allows the PL/Python module to do (SRF) functions. The patch was taken from the CVS version. I have modified the plpython.c file and have added a test sql script for testing the functionality. It was actually the script that was in the 8.0.3 version but have since been removed. In order to signal the end of a set, the called python function must simply return plpy.EndOfSet and the set would be returned. Gerrit van Dyk
1 parent 576ac4b commit 2d6c375

File tree

2 files changed

+1
-28
lines changed

2 files changed

+1
-28
lines changed

src/pl/plpython/plpython.c

+1-16
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
* MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
3030
*
3131
* IDENTIFICATION
32-
* $PostgreSQL: pgsql/src/pl/plpython/plpython.c,v 1.63 2005/07/04 18:59:42 momjian Exp $
32+
* $PostgreSQL: pgsql/src/pl/plpython/plpython.c,v 1.64 2005/07/05 18:15:51 momjian Exp $
3333
*
3434
*********************************************************************
3535
*/
@@ -286,9 +286,6 @@ static PyObject *PLy_exc_error = NULL;
286286
static PyObject *PLy_exc_fatal = NULL;
287287
static PyObject *PLy_exc_spi_error = NULL;
288288

289-
/* End-of-set Indication */
290-
static PyObject *PLy_endofset = NULL;
291-
292289
/* some globals for the python module
293290
*/
294291
static char PLy_plan_doc[] = {
@@ -773,16 +770,6 @@ PLy_function_handler(FunctionCallInfo fcinfo, PLyProcedure * proc)
773770
fcinfo->isnull = true;
774771
rv = (Datum) NULL;
775772
}
776-
/* test for end-of-set condition */
777-
else if (fcinfo->flinfo->fn_retset && plrv == PLy_endofset)
778-
{
779-
ReturnSetInfo *rsi;
780-
781-
fcinfo->isnull = true;
782-
rv = (Datum)NULL;
783-
rsi = (ReturnSetInfo *)fcinfo->resultinfo;
784-
rsi->isDone = ExprEndResult;
785-
}
786773
else
787774
{
788775
fcinfo->isnull = false;
@@ -2330,11 +2317,9 @@ PLy_init_plpy(void)
23302317
PLy_exc_error = PyErr_NewException("plpy.Error", NULL, NULL);
23312318
PLy_exc_fatal = PyErr_NewException("plpy.Fatal", NULL, NULL);
23322319
PLy_exc_spi_error = PyErr_NewException("plpy.SPIError", NULL, NULL);
2333-
PLy_endofset = PyErr_NewException("plpy.EndOfSet",NULL,NULL);
23342320
PyDict_SetItemString(plpy_dict, "Error", PLy_exc_error);
23352321
PyDict_SetItemString(plpy_dict, "Fatal", PLy_exc_fatal);
23362322
PyDict_SetItemString(plpy_dict, "SPIError", PLy_exc_spi_error);
2337-
PyDict_SetItemString(plpy_dict, "EndOfSet", PLy_endofset);
23382323

23392324
/*
23402325
* initialize main module, and add plpy

src/pl/plpython/sql/plpython_setof.sql

-12
This file was deleted.

0 commit comments

Comments
 (0)