Re: [PATCH] Add get_bytes() and set_bytes() functions

From: Aleksander Alekseev <aleksander(at)timescale(dot)com>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Cc: Joel Jacobson <joel(at)compiler(dot)org>
Subject: Re: [PATCH] Add get_bytes() and set_bytes() functions
Date: 2024-08-14 11:31:31
Message-ID: CAJ7c6TNVbeNsxbbj1QJTcjdkHRmJUBfF=iv_dOMDAGxoKY9CyQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

> +1
>
> I wanted this myself many times.
>
> I wonder if get_bytes() and set_bytes() will behave differently
> on little-endian vs big-endian systems?
>
> If so, then I think it would be nice to enforce a consistent byte order
> (e.g., big-endian), to ensure consistent behavior across platforms.

No, the returned value will not depend on the CPU endiness. Current
implementation uses big-endian / network order which in my humble
opinion is what most users would expect.

I believe we also need reverse(bytea) and repeat(bytea, integer)
functions e.g. for those who want little-endian. However I want to
propose them separately when we are done with this patch.

--
Best regards,
Aleksander Alekseev

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bertrand Drouvot 2024-08-14 11:32:14 define PG_REPLSLOT_DIR
Previous Message Joel Jacobson 2024-08-14 11:21:49 Re: [PATCH] Add get_bytes() and set_bytes() functions