I wrote: > It would be easier to get this done if you had addressed any of the > objections to the patch as given. Integer-overflow handling is still > missing, and you still are assuming that it's okay to change catalog > entries in released branches.
Since we are hard upon the feature freeze deadline, I took it on myself to split this apart. As far as I can see, the only part we really want to back-patch is the adjustment of the range-limit comparisons in byteaGetBit and byteaSetBit to use int64 arithmetic, so they don't go wacko when the input bytea exceeds 256MB. The other changes are not live bugs because in current usage the estimated result size of an encoding or decoding transform couldn't exceed 4 times 1GB. Hence it won't overflow size_t even on 32-bit machines, thus the check in palloc() is sufficient to deal with overlength values. But it's worth making those changes going forward, I suppose, in case somebody wants to deal with longer strings someday. There were some other minor problems too, but I think I fixed everything. regards, tom lane