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                       j...@nasby.net
512.569.9461 (cell)                         http://jim.nasby.net



-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to