さかなかです。
ありがとうございました。下記で出来ました(なぜか MyBackendId だ
と 1 が返ってきてしまった)。
#include "postgres.h"
#include "fgmr.h"
#include "storage/proc.h"
PG_FUNCTION_INFO_V1(pg_get_backendpid);
Datum pg_get_backendpid(PG_FUNCTION_ARGS)
{
PG_RETURN_INT32(MyProc->pid);
}
--さかなか