bytea_ouput = escape vs encode(byte, 'escape')

Поиск
Список
Период
Сортировка
От Jim Nasby
Тема bytea_ouput = escape vs encode(byte, 'escape')
Дата
Msg-id 6C8528E8-CF24-48BB-85E0-41D72C20B1AC@nasby.net
обсуждение исходный текст
Ответы Re: bytea_ouput = escape vs encode(byte, 'escape')  (David Johnston <polobo@yahoo.com>)
Список pgsql-hackers
I'm wondering why bytes_output = escape produces different output than encode(byte, 'escape') does. Is this
intentional?If so, why? 

cnuapp_prod@postgres=# select e'\r'::bytea AS cr, e'\n'::bytea AS lf; cr  |  lf
------+------\x0d | \x0a
(1 row)

cnuapp_prod@postgres=# set bytea_output = escape;
SET
cnuapp_prod@postgres=# select e'\r'::bytea AS cr, e'\n'::bytea AS lf; cr  |  lf
------+------\015 | \012
(1 row)

cnuapp_prod@postgres=# select encode(e'\r'::bytea,'escape') AS cr, encode(e'\n'::bytea, 'escape') AS lf;cr | lf
----+----\r |   +   |
(1 row)

cnuapp_prod@postgres=#
--
Jim C. Nasby, Data Architect                       jim@nasby.net
512.569.9461 (cell)                         http://jim.nasby.net




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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Modify the DECLARE CURSOR command tag depending on the scrollable flag
Следующее
От: Robert Haas
Дата:
Сообщение: Re: Suggestion: Issue warning when calling SET TRANSACTION outside transaction block