Hello, I can't to find reason of my problem. I have a varlena type. This type works well with plain storage, but this raise some random exception with extended storage. It finish on Assert((data - start) == data_size)[heaptuple.c]; I checked - when I return varlena from in function, then it has correct size, but in this function VARSIZE returns different value.
some log NOTICE: KOKES SIZE 36242, pointer: 149948300 -- varlena check NOTICE: heap_fill_tuple [size: 36250, bits -1, tupleesc: 150141444, attrs: 3 NOTICE: iteration 0 NOTICE: >>> attbyval 1, attlen 4 NOTICE: [data: 150208808d, data length: 4] NOTICE: iteration 1 NOTICE: >>> attbyval 1, attlen 4 NOTICE: [data: 150208812d, data length: 4] NOTICE: iteration 2 NOTICE: >>> attbyval 0, attlen -1 NOTICE: FULL VARLENA 149948300 <36242> -- correct size in heap_fill_tuple but NOTICE: KOKES SIZE 55966, pointer: 150029636, -- varlena size NOTICE: heap_fill_tuple [size: 55974, bits -1, tupleesc: 149930464, attrs: 3 NOTICE: iteration 0 NOTICE: >>> attbyval 1, attlen 4 NOTICE: [data: 150029680d, data length: 4] NOTICE: iteration 1 NOTICE: >>> attbyval 1, attlen 4 NOTICE: [data: 150029684d, data length: 4] NOTICE: iteration 2 NOTICE: >>> attbyval 0, attlen -1 NOTICE: FULL VARLENA 150029636 <13999> -- wrong size, why? NOTICE: 14007 [55974] psql83:/home/pavel/src/postgresql-8.3.7/contrib/kokes/objerr1.sql:4: server closed the connection unexpectedly This probably means the server terminated abnormally before or while processing the request. any idea, why size of varlena is broken? thank you Pavel Stehule p.s. I use macros SET_VARSIZE and VARSIZE define DatumGetKokesData(x)<-->((KokesData*)DatumGetPointer(x)) #define PG_GETARG_KokesData(x)<>DatumGetKokesData( PG_DETOAST_DATUM(PG_GETARG_DATUM(x)) ) #define PG_RETURN_KokesData(x)<>PG_RETURN_POINTER(x) -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers