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

Aleksander Alekseev <aleksander@timescale.com>

From: Aleksander Alekseev <aleksander@timescale.com>
To: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Cc: Dean Rasheed <dean.a.rasheed@gmail.com>, Alvaro Herrera <alvherre@alvh.no-ip.org>, Michael Paquier <michael@paquier.xyz>, Peter Eisentraut <peter@eisentraut.org>
Date: 2025-01-14T13:25:19Z
Lists: pgsql-hackers

Attachments

Hi Dean,

> Those are all instances of a value that's outside a specific range
> that you might not otherwise know, rather than being out of range of
> the type itself. For that, we generally don't say what the range of
> the type is. For example, we currently do:
>
> select repeat('1', 50)::bit(50)::int;
> ERROR:  integer out of range

Thanks. I agree that the proposed error messages look nicer than the
one I used in v6. Here is the corrected patch.


--
Best regards,
Aleksander Alekseev

Commits

  1. Allow casting between bytea and integer types.