Add bms_prev_member function

Enterprise / PostgreSQL - Alvaro Herrera [] - 7 April 2018 20:54 EDT

This works very much like the existing bms_last_member function, only it traverses through the Bitmapset in the opposite direction from the most significant bit down to the least significant bit. A special prevbit value of-1 may be used to have the function determine the most significant bit. This is useful for starting a loop. When there are no members less than prevbit, the function returns -2 to indicate there are no more members.

Author: David Rowley Discussion:

5c0675215e Add bms_prev_member function
src/backend/nodes/bitmapset.c | 95 +++++++++++++++++++++++++++++++++++++++++++
src/include/nodes/bitmapset.h | 1 +
2 files changed, 96 insertions(+)


  • Share