diff --git a/src/cdata.c b/src/cdata.c
index 32e8e4d0b8dbad51c5ec428d95b70543faefeca6..03fefbc6c510f45556c76237472c1139895e7365 100644 (file)
--- a/src/cdata.c
+++ b/src/cdata.c
PG_FUNCTION_INFO_V1(cdata_to_cdata);
PG_FUNCTION_INFO_V1(int32_to_cdata);
+PG_FUNCTION_INFO_V1(cdata_to_float8);
PG_FUNCTION_INFO_V1(cdata_update);
PG_RETURN_CDATA_P(data);
} /* int32_to_cdata */
+Datum
+cdata_to_float8(PG_FUNCTION_ARGS)
+{
+ cdata_t *data;
+
+ if (PG_NARGS() != 1)
+ ereport(ERROR, (
+ errmsg("cdata_to_float8() expects one argument"),
+ errhint("Usage: cdata_to_float8(cdata)")
+ ));
+
+ data = PG_GETARG_CDATA_P(0);
+ PG_RETURN_FLOAT8(data->value);
+} /* cdata_to_float8 */
+
Datum
cdata_update(PG_FUNCTION_ARGS)
{