Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <postgres.h>
- #include <fmgr.h>
- #include <executor.h>
- #ifdef PG_MODULE_MAGIC
- PG_MODULE_MAGIC;
- #endif
- PG_FUNCTION_INFO_V1(apr);
- Datum apr(PG_FUNCTION_ARGS) {
- bool isnull;
- HeapTupleHeader t = PG_GETARG_HEAPTUPLEHEADER(0);
- Datum d = GetAttributeByName(t, "t", &isnull);
- float4 r = DatumGetFloat8(d);
- PG_RETURN_FLOAT4(r);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement