SPI_cursor_open_with_args <refpurpose>set up a cursor using a query and parameters</refpurpose> — 問い合わせとパラメータを使ってカーソルを設定する
Portal SPI_cursor_open_with_args(const char *name, const char *command, intnargs, Oid *argtypes, Datum *values, const char *nulls, boolread_only, intcursorOptions)
   <function>SPI_cursor_open_with_args</function> sets up a cursor
   (internally, a portal) that will execute the specified query.
   Most of the parameters have the same meanings as the corresponding
   parameters to <function>SPI_prepare_cursor</function>
   and <function>SPI_cursor_open</function>.
SPI_cursor_open_with_argsは特定の問い合わせを実行するカーソル(内部的にはポータル)を設定します。
ほとんどのパラメータはSPI_prepare_cursorとSPI_cursor_openに対応するパラメータと同じ意味を持っています。
  
   For one-time query execution, this function should be preferred
   over <function>SPI_prepare_cursor</function> followed by
   <function>SPI_cursor_open</function>.
   If the same command is to be executed with many different parameters,
   either method might be faster, depending on the cost of re-planning
   versus the benefit of custom plans.
1回限りの問い合わせ実行に対しては、後にSPI_cursor_openが続いたSPI_prepare_cursorよりも、この関数を選ぶべきです。
多くの異なったパラメータを持つ同一のコマンドを実行する場合、再計画のコストと独自計画による利益に依存して、どちらか一方の方法がより早くなります。
  
The passed-in parameter data will be copied into the cursor's portal, so it can be freed while the cursor still exists. 渡されたパラメータデータはカーソルのポータルにコピーされますので、カーソルが存在している間は解放することができます。
   This function is now deprecated in favor
   of <function>SPI_cursor_parse_open</function>, which provides equivalent
   functionality using a more modern API for handling query parameters.
この関数は、問い合わせパラメータを取り扱う、より新しいAPIを使って等価な機能を提供するSPI_cursor_parse_openのため現在では廃止予定です。
  
const char * name
      name for portal, or <symbol>NULL</symbol> to let the system
      select a name
ポータルの名前、またはシステムに名前を選択させるNULL
     
const char * commandcommand string コマンド文字列
int nargs
      number of input parameters (<literal>$1</literal>, <literal>$2</literal>, etc.)
入力パラメータ($1、$2など)の数
     
Oid * argtypes
      an array of length <parameter>nargs</parameter>, containing the
      <acronym>OID</acronym>s of the data types of the parameters
パラメータのデータ型のOIDを含む、nargs長の配列
     
Datum * values
      an array of length <parameter>nargs</parameter>, containing the actual
      parameter values
実パラメータ値を含む、nargs長の配列
     
const char * nulls
      an array of length <parameter>nargs</parameter>, describing which
      parameters are null
どのパラメータがnullかを記述する、nargs長の配列
     
      If <parameter>nulls</parameter> is <symbol>NULL</symbol> then
      <function>SPI_cursor_open_with_args</function> assumes that no parameters
      are null.  Otherwise, each entry of the <parameter>nulls</parameter>
      array should be <literal>' '</literal> if the corresponding parameter
      value is non-null, or <literal>'n'</literal> if the corresponding parameter
      value is null.  (In the latter case, the actual value in the
      corresponding <parameter>values</parameter> entry doesn't matter.)  Note
      that <parameter>nulls</parameter> is not a text string, just an array:
      it does not need a <literal>'\0'</literal> terminator.
nullsがNULLであれば、SPI_cursor_open_with_argsはどのパラメータもnullでないとみなします。
さもなければ、nulls配列の各項目は、対応するパラメータが非NULLならば' '、対応するパラメータがNULLならば'n'です。
(後者の場合、values内の対応する値は注意されません。)
nullsはテキスト文字列ではなく単なる配列であることに注意してください。
'\0'終端は必要ありません。
     
bool read_only
読み取りのみの実行の場合true
     
int cursorOptionsinteger bit mask of cursor options; zero produces default behavior カーソルオプションの整数ビットマスク。ゼロの場合はデフォルトの動作
   Pointer to portal containing the cursor.  Note there is no error
   return convention; any error will be reported via <function>elog</function>.
カーソルを含んだポータルへのポインタ。
エラーを返す規約がないことに注意してください。
すべてのエラーはelogで報告されます。