Leonardo F <m_lists(at)yahoo(dot)it> writes:> I've even got > "ERROR: invalid memory alloc request size 4244635647" > with:> SELECT substring(B'1111000000000001' from 5 for -2);
Hm, yeah, somebody was sloppy about exposing the three-argumentform of varbit substring and using -1 to represent the two-argumentform.
What we can do in the back branches is make the code treat anynegative value as meaning two-arg form. To throw an error we'dneed to refactor the pg_proc representation ...
regards, tom lane