Thread: unescaped output of bytea

unescaped output of bytea

From
sad
Date:
Good day Guru

I thought on output to input relation in general.

Manual says about scalar types that input and output functions should be
inverse to each other, because of dump problems (if output function prints
a value not in a format that input function waiting for)

That's the geat problem i thought. If so then an external representation
could not be deffer of  SQL-constant representation (clear?)
Very common problem it is.
Most fields in this case should be manually (application level) transformed
both directions.

Then I try the experiment with text constant and text field dump:

INSERT INTO ttt values ('a\\b\'c''');
SELECT * FROM ttt; fff
--------a\b'c'

I see the output not inverse to the input.
then I DUMP the table ttt and see into the dump file:

INSERT INTO ttt VALUES ('a\\b\'c''');

THAT'S IT !!! Dump DIFFERS to plain output !
the same result with escaping apostroph we could see in bytea type.

this GOOD, VERY GOOD fact allows us to have unescaped output of bytea
without problems with a dump.