Re: ERROR: index row size

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: ERROR: index row size
Дата
Msg-id 1935.1180929199@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: ERROR: index row size  (Jeremy Drake <pgsql@jdrake.com>)
Ответы Re: ERROR: index row size  ("Rodrigo Sakai" <rodrigo.sakai@poli.usp.br>)
Список pgsql-hackers
Jeremy Drake <pgsql@jdrake.com> writes:
>> char    tvi_char[MAXDATEFIELDS];
>> 
>> tvi_char = (char *) palloc(strlen(MAXDATEFIELDS));

> What are you doing here?  This is completely broken.

Indeed ... *please* tell us your compiler issued a warning about that.
If not an error --- none of the compilers I use will take it at all.
Maybe you need to get a real C compiler.

>> result->tvi = StringToDateADT(tvi_char);
>> result->tvi = StringToDateADT(tvf_char);
>> 
>> result = (Periodo *) palloc(sizeof(Periodo));

Well, you oughta allocate result before you store into it, not after,
and I bet you meant to assign to the tvi and tvf fields, not tvi twice.

Bad as these mistakes are, they don't directly explain why a later index
entry creation would fail.  What I'm betting is that your CREATE TYPE
command does not correctly describe the datatype size.  Based on this
code it should be pass-by-reference, fixed-size-8-bytes, but I'll bet
a nickel your CREATE TYPE says something else --- probably varlena.
        regards, tom lane


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: What is happening on buildfarm member baiji?
Следующее
От: "Rodrigo Sakai"
Дата:
Сообщение: Re: ERROR: index row size