File tree Expand file tree Collapse file tree 2 files changed +9
-14
lines changed Expand file tree Collapse file tree 2 files changed +9
-14
lines changed Original file line number Diff line number Diff line change 1111 <para>
1212 All calls to functions that are written in a language other than
1313 the current <quote>version 1</quote> interface for compiled
14- languages (this includes functions in user-defined procedural languages,
15- functions written in SQL, and functions using the version 0 compiled
16- language interface) go through a <firstterm>call handler</firstterm>
14+ languages (this includes functions in user-defined procedural languages
15+ and functions written in SQL) go through a <firstterm>call handler</firstterm>
1716 function for the specific language. It is the responsibility of
1817 the call handler to execute the function in a meaningful way, such
1918 as by interpreting the supplied source text. This chapter outlines
Original file line number Diff line number Diff line change @@ -4583,17 +4583,19 @@ INSERT INTO a SELECT * FROM a;
45834583
45844584PG_MODULE_MAGIC;
45854585
4586- int64 execq(text *sql, int cnt );
4586+ PG_FUNCTION_INFO_V1(execq );
45874587
4588- int64
4589- execq(text *sql, int cnt )
4588+ Datum
4589+ execq(PG_FUNCTION_ARGS )
45904590{
45914591 char *command;
4592+ int cnt;
45924593 int ret;
45934594 uint64 proc;
45944595
45954596 /* Convert given text object to a C string */
4596- command = text_to_cstring(sql);
4597+ command = text_to_cstring(PG_GETARG_TEXT_PP(1));
4598+ cnt = PG_GETARG_INT32(2);
45974599
45984600 SPI_connect();
45994601
@@ -4626,16 +4628,10 @@ execq(text *sql, int cnt)
46264628 SPI_finish();
46274629 pfree(command);
46284630
4629- return proc;
4631+ PG_RETURN_INT64( proc) ;
46304632}
46314633</programlisting>
46324634
4633- <para>
4634- (This function uses call convention version 0, to make the example
4635- easier to understand. In real applications you should use the new
4636- version 1 interface.)
4637- </para>
4638-
46394635 <para>
46404636 This is how you declare the function after having compiled it into
46414637 a shared library (details are in <xref linkend="dfunc"/>.):
You can’t perform that action at this time.
0 commit comments