Re: manipulating NUMERIC values in C extension

From: Geoff Winkless <pgsqladmin(at)geoff(dot)dj>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: manipulating NUMERIC values in C extension
Date: 2018-06-08 12:47:49
Message-ID: CAEzk6ffs9DBEbypK53Sg4DMQi6Rr1BFLaLR2ApGoQzodO2NgOA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, 8 Jun 2018 at 13:27, Geoff Winkless <pgsqladmin(at)geoff(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Geoff Winkless 2018-06-08 13:06:53 Re: manipulating NUMERIC values in C extension
Previous Message John McKown 2018-06-08 12:44:25 Re: manipulating NUMERIC values in C extension