1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-28 23:42:10 +03:00

Add reverse(bytea).

This commit introduces a function for reversing the order of the
bytes in binary strings.

Bumps catversion.

Author: Aleksander Alekseev <aleksander@timescale.com>
Discussion: https://postgr.es/m/CAJ7c6TMe0QVRuNssUArbMi0bJJK32%2BzNA3at5m3osrBQ25MHuw%40mail.gmail.com
This commit is contained in:
Nathan Bossart
2025-03-13 11:20:53 -05:00
parent bb25276205
commit 0697b23906
6 changed files with 64 additions and 1 deletions

View File

@ -4660,6 +4660,23 @@ SELECT format('Testing %3$s, %2$s, %s', 'one', 'two', 'three');
</para></entry>
</row>
<row>
<entry role="func_table_entry"><para role="func_signature">
<indexterm>
<primary>reverse</primary>
</indexterm>
<function>reverse</function> ( <type>bytea</type> )
<returnvalue>bytea</returnvalue>
</para>
<para>
Reverses the order of the bytes in the binary string.
</para>
<para>
<literal>reverse('\xabcd'::bytea)</literal>
<returnvalue>\xcdab</returnvalue>
</para></entry>
</row>
<row>
<entry role="func_table_entry"><para role="func_signature">
<indexterm>