Hi,
On Feb 22, 2018, at 9:31 PM, Michael Paquier wrote:
> PG_GETARG_NUMERIC(), no?
That function returns an object of datatype “Numeric” which still requires some
(not immediately obvious) conversation to a double (or whatever primitive C
type).
> When working on
Michael Paquier writes:
> On Thu, Feb 22, 2018 at 08:00:45PM -0500, Demitri Muna wrote:
>> Out of curiosity, how does one read a numeric type from within a C
>> extension (i.e. get a number value out of the Datum type)?
> PG_GETARG_NUMERIC(), no?
I think the core point here
On Thu, Feb 22, 2018 at 08:00:45PM -0500, Demitri Muna wrote:
> Ah, I wasn’t aware of implicit coercion. Yes, that solves the problem
> perfectly, thanks.
>
> Out of curiosity, how does one read a numeric type from within a C
> extension (i.e. get a number value out of the Datum type)? I ask as
Hi Tom,
On Feb 20, 2018, at 10:54 PM, Tom Lane wrote:
> Well, the implicit coercions work in your favor in this particular case.
Ah, I wasn’t aware of implicit coercion. Yes, that solves the problem
perfectly, thanks.
Out of curiosity, how does one read a numeric type
Demitri Muna writes:
> I’m writing a C extension for PostgreSQL. One possible input datatype for my
> function is a numeric array, e.g. ARRAY[[1.5,2.5],[3.5,4.5]]. I can use
> “DatumGetNumeric” to extract a “Numeric” data type from the data, but at some
> point I need
Hi,
I’m writing a C extension for PostgreSQL. One possible input datatype for my
function is a numeric array, e.g. ARRAY[[1.5,2.5],[3.5,4.5]]. I can use
“DatumGetNumeric” to extract a “Numeric” data type from the data, but at some
point I need to convert this to a number (e.g. double) so that