Re: arrays of floating point numbers / linear algebra operations into the DB - Mailing list pgsql-general

From Enrico Sirola
Subject Re: arrays of floating point numbers / linear algebra operations into the DB
Date
Msg-id 47A5ED57.8070606@gmail.com
Whole thread Raw
In response to Re: arrays of floating point numbers / linear algebra operations into the DB  (Enrico Sirola <enrico.sirola@gmail.com>)
List pgsql-general
I respond myself:

Enrico Sirola ha scritto:

[...]

> seems to work). The problem for the code above is that it doesn't work
> for vectors longer than 1000 elements or so (try it with 2000 and it
> doesn't work). I guess I should manage the "toasting" machinery in some
> ways - any suggestion is appreciated

wrong. it was just that I forgot to add ARR_OVERHEAD_NONULLS(ndims1) to
the mem allocation for rv:

rv = (ArrayType *) palloc(nbytes);

becomes

rv = (ArrayType *) palloc(nbytes) +  ARR_OVERHEAD_NONULLS(ndims1);

and now it seems to work :)

pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: temp sequence
Next
From: Shane Ambler
Date:
Subject: Re: [OT] "advanced" database design (long)