You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be nice if Postgres supported a native reverse(bytea) function. Currently we're manually reversing byteas with this plpgsql function (which is presumably somewhat slower than a native option?):
reversed bytea := source_bytes; -- set result to proper length
BEGIN
FOR i IN0..last_source_index LOOP
reversed := set_byte(reversed, i, get_byte(source_bytes, last_source_index - i));
END LOOP;
RETURN reversed;
END;
$$;
COMMENT ON FUNCTION reverse_bytea(bytea) IS 'Reverse the byte order of a bytea.';
There doesn't seem to be a good reason why Postgres wouldn't support reversing bytea types natively. We might want to submit a patch. Looks like we'd need to add it to src/backend/utils/adt/varlena.c (see text_reverse).
The text was updated successfully, but these errors were encountered:
It would be nice if Postgres supported a native
reverse(bytea)
function. Currently we're manually reversingbytea
s with thisplpgsql
function (which is presumably somewhat slower than a native option?):chaingraph/images/hasura/hasura-data/migrations/default/1616195337538_init/up.sql
Lines 719 to 732 in cbebede
There doesn't seem to be a good reason why Postgres wouldn't support reversing
bytea
types natively. We might want to submit a patch. Looks like we'd need to add it tosrc/backend/utils/adt/varlena.c
(seetext_reverse
).The text was updated successfully, but these errors were encountered: