Re: C function to return double precision[][]

Поиск
Список
Период
Сортировка
От Joe Conway
Тема Re: C function to return double precision[][]
Дата
Msg-id 714e6e48-1ad0-9172-2731-9682e0266dc7@joeconway.com
обсуждение исходный текст
Ответ на C function to return double precision[][]  (Markur Sens <markursens@gmail.com>)
Список pgsql-hackers
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#L1275

which points to here with number of dims == 2:

https://github.com/postgres-plr/plr/blob/20a1f133bcf2bc8f37ac23da191aea590d612619/pg_conversion.c#L1493

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




В списке pgsql-hackers по дате отправления:

Предыдущее
От: Nathan Bossart
Дата:
Сообщение: Re: Optimize Arm64 crc32 implementation in PostgreSQL
Следующее
От: Robert Haas
Дата:
Сообщение: Re: should frontend tools use syncfs() ?