Jeremy Drake <pgsql(at)jdrake(dot)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
In response to
pgsql-hackers by date
|Next:||From: Rodrigo Sakai||Date: 2007-06-04 03:59:18|
|Subject: Re: ERROR: index row size|
|Previous:||From: Tom Lane||Date: 2007-06-04 03:29:33|
|Subject: Re: What is happening on buildfarm member baiji? |