>>Some more comments on the patch
>> struct pg_encoding
>> {
>>- unsigned (*encode_len) (const char *data, unsigned dlen);
>>+ int64 (*encode_len) (const char *data, unsigned dlen);
>> unsigned (*decode_len) (const char *data, unsigned dlen);
>> unsigned (*encode) (const char *data, unsigned dlen, char *res);
>> unsigned (*decode) (const char *data, unsigned dlen, char *res);
>> Why not use return type of int64 for rest of the functions here as well?
>> res = enc->encode(VARDATA_ANY(data), datalen, VARDATA(result));
>> /* Make this FATAL 'cause we've trodden on memory ... */
>>- if (res > resultlen)
>>+ if ((int64)res > resultlen)
>>
>>if we change return type of all those functions to int64, we won't need this cast.
>I change the 'encode' function, it needs an int64 return type, but keep other