1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
#include "postgres.h" #include "fmgr.h" PG_MODULE_MAGIC; extern int32 Adder(int32); PG_FUNCTION_INFO_V1(add_two); Datum add_two(PG_FUNCTION_ARGS) { int32 arg = PG_GETARG_INT32(0); PG_RETURN_INT32(Adder(arg)); }