Re: Non-decimal integer literals

Поиск
Список
Период
Сортировка
От Dean Rasheed
Тема Re: Non-decimal integer literals
Дата
Msg-id CAEZATCWBrJxCFpPf5vfpfP1-WR0PoLU8y8UMDMtyckNZ=r+M6w@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Non-decimal integer literals  ("Joel Jacobson" <joel@compiler.org>)
Список pgsql-hackers
On Mon, 23 Jan 2023 at 20:00, Joel Jacobson <joel@compiler.org> wrote:
>
> Nice! This also simplifies when dealing with non-negative integers represented as byte arrays,
> common in e.g. cryptography code.
>

Ah, interesting. I hadn't thought of that use-case.

> create function numeric_from_bytes(bytea) returns numeric language sql as $$
> select ('0'||right($1::text,-1))::numeric
> $$;
>
> Would we want a built-in function for this?

Not sure. It does feel a bit niche. It's quite common in other
programming languages, but that doesn't mean that a lot of Postgres
users need it. Perhaps start a new thread to gauge people's interest?

Regards,
Dean



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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: run pgindent on a regular basis / scripted manner
Следующее
От: Nathan Bossart
Дата:
Сообщение: Re: recovery modules