mirror of
https://github.com/postgres/postgres.git
synced 2025-06-29 10:41:53 +03:00
Clean up the API for DestReceiver objects by eliminating the assumption
that a Portal is a useful and sufficient additional argument for CreateDestReceiver --- it just isn't, in most cases. Instead formalize the approach of passing any needed parameters to the receiver separately. One unexpected benefit of this change is that we can declare typedef Portal in a less surprising location. This patch is just code rearrangement and doesn't change any functionality. I'll tackle the HOLD-cursor-vs-toast problem in a follow-on patch.
This commit is contained in:
@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/executor/functions.c,v 1.129 2008/11/27 00:10:04 tgl Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/executor/functions.c,v 1.130 2008/11/30 20:51:25 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -398,7 +398,7 @@ postquel_start(execution_state *es, SQLFunctionCachePtr fcache)
|
||||
{
|
||||
DR_sqlfunction *myState;
|
||||
|
||||
dest = CreateDestReceiver(DestSQLFunction, NULL);
|
||||
dest = CreateDestReceiver(DestSQLFunction);
|
||||
/* pass down the needed info to the dest receiver routines */
|
||||
myState = (DR_sqlfunction *) dest;
|
||||
Assert(myState->pub.mydest == DestSQLFunction);
|
||||
@ -1269,10 +1269,6 @@ check_sql_fn_retval(Oid func_id, Oid rettype, List *queryTreeList,
|
||||
|
||||
/*
|
||||
* CreateSQLFunctionDestReceiver -- create a suitable DestReceiver object
|
||||
*
|
||||
* Since CreateDestReceiver doesn't accept the parameters we'd need,
|
||||
* we just leave the private fields zeroed here. postquel_start will
|
||||
* fill them in.
|
||||
*/
|
||||
DestReceiver *
|
||||
CreateSQLFunctionDestReceiver(void)
|
||||
@ -1285,6 +1281,8 @@ CreateSQLFunctionDestReceiver(void)
|
||||
self->pub.rDestroy = sqlfunction_destroy;
|
||||
self->pub.mydest = DestSQLFunction;
|
||||
|
||||
/* private fields will be set by postquel_start */
|
||||
|
||||
return (DestReceiver *) self;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user