public inbox for [email protected]
help / color / mirror / Atom feedFrom: Joe Conway <[email protected]>
To: Markur Sens <[email protected]>
To: [email protected]
Subject: Re: C function to return double precision[][]
Date: Mon, 21 Aug 2023 16:04:53 -0400
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
On 8/21/23 15:31, Markur Sens wrote:
> Is there any piece of code I could see how to achieve $subject ?
> I haven’t found anything in the standard library or contrib modules.
>
> I’m trying to build ArrayType ** of sorts and return a Datum of those but I can’t seem to manage memory correctly.
There is an example in PL/R here:
https://github.com/postgres-plr/plr/blob/20a1f133bcf2bc8f37ac23da191aea590d612619/pg_conversion.c#L1...
which points to here with number of dims == 2:
https://github.com/postgres-plr/plr/blob/20a1f133bcf2bc8f37ac23da191aea590d612619/pg_conversion.c#L1...
This is all generic to the element type (i.e. not specifically float8),
but the needed type conversion stuff happens in here:
https://github.com/postgres-plr/plr/blob/20a1f133bcf2bc8f37ac23da191aea590d612619/plr.c#L1109
HTH,
--
Joe Conway
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com
view thread (2+ messages)
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected], [email protected]
Subject: Re: C function to return double precision[][]
In-Reply-To: <[email protected]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox