Re: escape vs. bytea in config

Поиск
Список
Период
Сортировка
Искать
От
Laurenz Albe
Тема
Re: escape vs. bytea in config
Дата
Msg-id
7c9dddd89d923275e9b5083100f75dfa4f169e9d.camel@cybertec.at
Ответ на
escape vs. bytea in config (Mathias Mayrhofer)
Список
Дерево обсуждения
escape vs. bytea in config Mathias Mayrhofer <mtmayr@mtmayr.com>
Re: escape vs. bytea in config "Peter J. Holzer" <hjp-pgsql@hjp.at>
Re: escape vs. bytea in config Laurenz Albe <laurenz.albe@cybertec.at>
On Tue, 2023-03-07 at 11:53 +0100, Mathias Mayrhofer wrote:
> -- /etc/postgresql/14/main/postgresql.conf
> -- bytea_output = 'escape'
> 
> db=> select encode(digest('mtmayr', 'sha256'), 'escape');
> ┌────────────────────────────────────────────────────────────────────────────────────────────┐
> │                                           encode                                           │
> ├────────────────────────────────────────────────────────────────────────────────────────────┤
> │ \277\x19\225\335g\307\224\337-\347Y\203\254\324\x1Ff\307Ph*\267\\\243\2515S\213WX\204\375G │
> └────────────────────────────────────────────────────────────────────────────────────────────┘
> 
> db=> select digest('mtmayr', 'sha256');
> ┌────────────────────────────────────────────────────────────────────────────────────────────┐
> │                                           digest                                           │
> ├────────────────────────────────────────────────────────────────────────────────────────────┤
> │ \277\031\225\335g\307\224\337-\347Y\203\254\324\037f\307Ph*\267\\\243\2515S\213WX\204\375G │
> └────────────────────────────────────────────────────────────────────────────────────────────┘
> 
> --    ^^  differences                             ^^^^

They are actually the same: octal 31 is hexadecimal 19.

The difference is between the "encode" function and the type putput function of "bytea".

Yours,
Laurenz Albe
-- 
Cybertec | https://www.cybertec-postgresql.com
В списке pgsql-general по дате отправления
От: Mathias Mayrhofer
Дата:
Сообщение: escape vs. bytea in config
От: Peter J. Holzer
Дата:
Сообщение: Re: escape vs. bytea in config
FAQ