mirror of
				https://github.com/postgres/postgres.git
				synced 2025-10-29 22:49:41 +03:00 
			
		
		
		
	In SRF example, move oldcontext variable definition into the FIRSTCALL
branch, which is how most actual code is actually structured. Also fix slight whitespace misalignment.
This commit is contained in:
		| @@ -1,4 +1,4 @@ | |||||||
| <!-- $PostgreSQL: pgsql/doc/src/sgml/xfunc.sgml,v 1.141 2009/11/23 21:41:20 petere Exp $ --> | <!-- $PostgreSQL: pgsql/doc/src/sgml/xfunc.sgml,v 1.142 2009/11/30 15:49:35 petere Exp $ --> | ||||||
|  |  | ||||||
|  <sect1 id="xfunc"> |  <sect1 id="xfunc"> | ||||||
|   <title>User-Defined Functions</title> |   <title>User-Defined Functions</title> | ||||||
| @@ -3034,11 +3034,12 @@ my_set_returning_function(PG_FUNCTION_ARGS) | |||||||
| { | { | ||||||
|     FuncCallContext  *funcctx; |     FuncCallContext  *funcctx; | ||||||
|     Datum             result; |     Datum             result; | ||||||
|     MemoryContext     oldcontext; |  | ||||||
|     <replaceable>further declarations as needed</replaceable> |     <replaceable>further declarations as needed</replaceable> | ||||||
|  |  | ||||||
|     if (SRF_IS_FIRSTCALL()) |     if (SRF_IS_FIRSTCALL()) | ||||||
|     { |     { | ||||||
|  |         MemoryContext oldcontext; | ||||||
|  |  | ||||||
|         funcctx = SRF_FIRSTCALL_INIT(); |         funcctx = SRF_FIRSTCALL_INIT(); | ||||||
|         oldcontext = MemoryContextSwitchTo(funcctx->multi_call_memory_ctx); |         oldcontext = MemoryContextSwitchTo(funcctx->multi_call_memory_ctx); | ||||||
|         /* One-time setup code appears here: */ |         /* One-time setup code appears here: */ | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user