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

Поиск
Список
Период
Сортировка
От Dean Rasheed
Тема Re: [PATCH] Add get_bytes() and set_bytes() functions
Дата
Msg-id CAEZATCV_UNv+wVg1FD_TXK3FizGhKYFBqOghq+UfoHrLDmr=aA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [PATCH] Add get_bytes() and set_bytes() functions  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
Список pgsql-hackers
On Mon, 13 Jan 2025 at 19:23, Alvaro Herrera <alvherre@alvh.no-ip.org> wrote:
>
> But these don't show the acceptable range. We have these that do:
>
> #: utils/adt/varbit.c:1824 utils/adt/varbit.c:1882
> #, c-format
> msgid "bit index %d out of valid range (0..%d)"
>
> #: utils/adt/varlena.c:3218 utils/adt/varlena.c:3285
> #, c-format
> msgid "index %d out of valid range, 0..%d"
>
> #: utils/adt/varlena.c:3249 utils/adt/varlena.c:3321
> #, c-format
> msgid "index %lld out of valid range, 0..%lld"
>
> #: utils/misc/guc.c:3130
> #, c-format
> msgid "%d%s%s is outside the valid range for parameter \"%s\" (%d .. %d)"
>

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

Regards,
Dean



В списке pgsql-hackers по дате отправления: