pgsql: Fix jsonb subscripting to cope with toasted subscript values.

2022-12-12 Thread Tom Lane
Fix jsonb subscripting to cope with toasted subscript values. jsonb_get_element() was incautious enough to use VARDATA() and VARSIZE() directly on an arbitrary text Datum. That of course fails if the Datum is short-header, compressed, or out-of-line. The typical result would be failing to match a

pgsql: Fix jsonb subscripting to cope with toasted subscript values.

2022-12-12 Thread Tom Lane
Fix jsonb subscripting to cope with toasted subscript values. jsonb_get_element() was incautious enough to use VARDATA() and VARSIZE() directly on an arbitrary text Datum. That of course fails if the Datum is short-header, compressed, or out-of-line. The typical result would be failing to match a

pgsql: Fix jsonb subscripting to cope with toasted subscript values.

2022-12-12 Thread Tom Lane
Fix jsonb subscripting to cope with toasted subscript values. jsonb_get_element() was incautious enough to use VARDATA() and VARSIZE() directly on an arbitrary text Datum. That of course fails if the Datum is short-header, compressed, or out-of-line. The typical result would be failing to match a