Re: C function working with input/ouput tables failed !

Поиск
Список
Период
Сортировка
От M. François Benoît-Marand
Тема Re: C function working with input/ouput tables failed !
Дата
Msg-id 1216899308.488868ec75efa@webmail.univ-poitiers.fr
обсуждение исходный текст
Ответ на C function working with input/ouput tables failed !  ("M. François Benoît-Marand"<francois.benoit-marand@univ-poitiers.fr>)
Список pgsql-general
FIRST PROBLEM IS SOLVED !

> First problem:
> When I try to get the input table, the first element is forgotten, then, the
> whole matrix is wrong! I have no idea of what happens…
>
> Example:
>      Input table                 Matrix obtained
>                             By reading tuple by tuple
>
>       1  0  2  0                    0  1  0  2
>       0  1  0  0                    0  0  1  0
>       0  0  1  0                    0  0  0  1
>       0  0  0  1                    0  0  0  0
>
> If you are interested to read the code:
> Look at the function called: compute_puissance_table
> At the line containing     : DBG(“Update of puissance_m”);
> --------------------

I change :
pm->data[i][j]= DatumGetInt32(SPI_getbinval(tuple,tupdesc, j, &isnull));
To :
pm->data[i][j]= DatumGetInt32(SPI_getbinval(tuple,tupdesc, j+1, &isnull));
In :
>            for (i = 0; i < nl; i++)
>              {
>                DBG("Tuple number %i\n", i+1);
>                HeapTuple tuple = tuptable->vals[i];
>                for (j = 0; j < nc; j++)
>                {
>                    pm->data[i][j]= DatumGetInt32(SPI_getbinval(tuple,
> tupdesc, j, &isnull));
>                }
>              }

In fact "SPI_getbinval(tuple,tupdesc, 0, &isnull));" returns NULL;

HOWEVER THE SECOND PROBLEM IS STILL OPEN !

Thanks for your reading!

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

Предыдущее
От: Ivan Sergio Borgonovo
Дата:
Сообщение: Re: php + postgresql
Следующее
От: Tomasz Ostrowski
Дата:
Сообщение: Re: Equality search on timestamp value returns no rows