Re: manipulating NUMERIC values in C extension - Mailing list pgsql-general

From Geoff Winkless
Subject Re: manipulating NUMERIC values in C extension
Date
Msg-id CAEzk6ffs9DBEbypK53Sg4DMQi6Rr1BFLaLR2ApGoQzodO2NgOA@mail.gmail.com
Whole thread Raw
In response to manipulating NUMERIC values in C extension  (Geoff Winkless <pgsqladmin@geoff.dj>)
Responses Re: manipulating NUMERIC values in C extension  (Geoff Winkless <pgsqladmin@geoff.dj>)
List pgsql-general
On Fri, 8 Jun 2018 at 13:27, Geoff Winkless <pgsqladmin@geoff.dj> wrote:
> numeric_in looks like it might do what I want but to do that I would
> have to build a FunctionCallInfo struct to do that, and I'm not 100%
> clear how to do that either :(

Answering my own question, looks like

  res = DatumGetNumeric(DirectFunctionCall3(numeric_in,
CStringGetDatum(buf), 0, -1));

should do it, judging from
https://api.pgxn.org/src/orafce/orafce-3.6.1/convert.c

Geoff


pgsql-general by date:

Previous
From: John McKown
Date:
Subject: Re: manipulating NUMERIC values in C extension
Next
From: Geoff Winkless
Date:
Subject: Re: manipulating NUMERIC values in C extension