- 追加された行はこの色です。
- 削除された行はこの色です。
#author("2017-06-01T22:03:41+09:00","default:haikikyou","haikikyou")
#author("2017-06-03T13:40:28+09:00","default:haikikyou","haikikyou")
[[PostgreSQL/開発]]
#contents
* 概要 [#t03f8105]
- 概要説明
* 定義 [#m6ff2469]
** 変数,エイリアス [#r6993c38]
** マクロ [#n3bffc31]
** 列挙型 [#jc93a4e3]
** 構造体 [#e4aded44]
*** Struct [#ce92b362]
|~番号|~データ型|~フィールド|~説明|h
** 関数 [#ydff81f8]
*** 関数名 [#r22bc55b]
#geshi(c){{
// 引数1:
}}
- 説明
* サンプルプログラム [#xcd4fcab]
#geshi(c){{
// sample
// 関数呼び出しのサンプル
void test_func_invoke()
{
FmgrInfo *fmgr = palloc(sizeof(FmgrInfo));
// ここでは,サンプルのため決め打ちで関数のOidを指定している
fmgr_info((Oid)1396, fmgr); // abs(int64);
int64 arg0 = -100; // 引数
FunctionCallInfoData fcinfo;
InitFunctionCallInfoData(fcinfo, fmgr, 1, 0, NULL, NULL);
fcinfo.isnull = false; // 結果はnullでない
fcinfo.argnull[0] = false; // 引数なnullでない
fcinfo.arg[0] = Int64GetDatum(arg0); // 引数を設定
// 関数の実行。fmgr_infoで実際に呼び出される関数ポインタがfcinfoにセットされている
Datum result = FunctionCallInvoke(&fcinfo);
// 結果Datumから値を取り出す
elog(INFO, "abs(-100) = %ld", DatumGetInt64(result));
}
/* Output is the following:
------------------------------
INFO: abs(-100) = 100
*/
}}
* 参考・関連 [#hbd36355]
- [[fmgr.h>https://doxygen.postgresql.org/fmgr_8h.html]] - on doxygen.postgresql.org
- [[fmgr.c>https://doxygen.postgresql.org/fmgr_8c.html]] - on doxygen.postgresql.org
&size(12){&color(white,orange){ 関連 };};
#related
* コメント [#cd6bf6cf]
#comment