--- pgmecab.c.orig 2008-10-05 13:24:34.000000000 +0200 +++ pgmecab.c 2008-10-05 13:25:17.000000000 +0200 @@ -24,7 +24,7 @@ static Datum returnEmptyStr() { text* emptyVal = (text*) palloc(VARHDRSZ); - VARATT_SIZEP(emptyVal) = VARHDRSZ; + SET_VARSIZE(emptyVal, VARHDRSZ); PG_RETURN_TEXT_P(emptyVal); } @@ -90,7 +90,7 @@ /* 返すためのメモリ確保 */ text* return_val = (text *) palloc(VARHDRSZ + mecab_result_size * sizeof(char)); - VARATT_SIZEP(return_val) = VARHDRSZ + mecab_result_size * sizeof(char); + SET_VARSIZE(return_val, VARHDRSZ + mecab_result_size * sizeof(char)); /* 結果をコピー */ memcpy((void*)VARDATA(return_val), mecab_result, mecab_result_size);